"Like" operator in a query

G

Guest

In "SQL Server Compatible Syntax" setting in Options dialog; Table/Queries
tab, I do not check "This database".

In this database the following query returns two records:
SELECT Filters.Filter FROM Filters WHERE (((Filters.Filter) Like
"*Classes*"));

If I write code as follows, it returns no records:

Dim adoRS As New ADODB.Recordset
sSQL = "SELECT Filters.Filter FROM Filters WHERE (((Filters.Filter) Like
""*Classes*""));"

adoRS.Open sSQL, oConn
If adoRS.EOF Then
Debug.Print "No Records"
End If

Is there a way to get ADODB code to properly handle the "Like" operator?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top