Article ID: 181487
Article Last Modified on 3/14/2005
226119 INFO: ADO's Find and Filter Support Usage of Wildcards
Sub FilterEqualFails()
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "<DSN_Name>", "sa", ""
On Error Resume Next
conn.Execute "drop table Test"
On Error GoTo errh
conn.Execute "create table Test(id int primary key,f1 " & _
"varchar(200))"
rs.Open "select * from Test", 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: kbbug kbfix kbdatabase kbado200fix kbmdacnosweep KB181487