BUG: ADO Filter Fails if Filter String Contains '*strval'

Last reviewed: February 23, 1998
Article ID: Q181487
The information in this article applies to:
  • ActiveX Data Objects (ADO), version 1.5

SYMPTOMS

Receiving error 3001 using an ADODB.Recordset when the filter string contains '*stringvalue' pattern for the string column even if the operator is '='.

CAUSE

The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Put_Filter fails if the filter string contains '*stringvalue' pattern for The string column even if the operator is '='. It should not fail. It acts like LIKE syntax.

Steps to Reproduce Behavior

   Sub FilterEqualFails()
       Dim conn As New Connection
       Dim rs As New Recordset

       conn.Open "SpringHill", "sa", ""
       On Error Resume Next
       conn.Execute "drop table Foo"
        On Error GoTo errh
       conn.Execute "create table Foo(id int primary key,f1 " & _
                    "varchar(200), f2 binary(200))"
       rs.Open "select * from Foo", conn, adOpenKeyset, adLockOptimistic
       rs.AddNew
       rs("id") = 1
       rs("f1") = "*x Hello world"
       rs.Update
       rs.Requery
       rs.filter = "f1 = '*x Hello world'"
       Exit Sub
   errh:
       Debug.Print "Error:", Err, Hex(Err)
       Debug.Print "Source:", Err.Source
       Debug.Print "Desc:", Err.Description

   End Sub

When you execute this code you expect it to find the row with the value. However, this is the output received when you execute the code:

   Error:        3001         BB9
   Source:       ADODB.Recordset

Keywords          : kbcode adoall kbbuglist
Version           : WINDOWS:1.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 23, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.