Using LIKE Operator

O

OldEnough

Is the LIKE operator permitted in ADO. I get an Error 0 Operation Not
Supported in ODBC ... when I try to code a search string. The syntax works
for local database tables but fails when I try to pull records from unlinked
back end using ODBC connection string.

SELECT tblMyTable.* FROM tblMyTable WHERE (((tblMyTable.strLinkCriteria)
LIKE '*somestring*'));

I tried substituting % for * and that doesn't seem to make a difference. Any
advice would be appreciated.
 
D

Douglas J. Steele

Yes, ADO supports the LIKE operator. The wildcard character with ADO is %,
not *.

Are you sure that the text somestring exists in the field?
 
O

OldEnough

Thanks for your response. I spent hours working with this yesterday.
I don't know what was wrong with the code. I copied it over to send to you
to look at, and ran the code again before sending it and it works perfectly
now.
 

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