BUG: ADO Filter Fails if Filter String Contains '*strval'Last reviewed: February 23, 1998Article ID: Q181487 |
The information in this article applies to:
SYMPTOMSReceiving error 3001 using an ADODB.Recordset when the filter string contains '*stringvalue' pattern for the string column even if the operator is '='.
CAUSEThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
STATUSMicrosoft 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 INFORMATIONPut_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 |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |