Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LIKE operator
Message
 
To
15/04/2005 08:09:07
General information
Forum:
Visual Basic
Category:
Access
Title:
Miscellaneous
Thread ID:
01005052
Message ID:
01005060
Views:
17
This message has been marked as the solution to the initial question of the thread.
If you are using ADO, use replace * with % like this:
"SELECT * FROM table WHERE field1 LIKE '%" & scriteria & "%' "
>Hello,
>
>How do I use a LIKE operator in a sql string from VB6 to Access.
>
>Right now i'm building my string like this :
>"SELECT * FROM table WHERE field1 LIKE '*" & scriteria & "*' "
>
>It does not work (I get nothing where I should get 9 records)... but if I copy the string into Access (as is from VB) all of the records are retrieved.
>
>I guess the ODBC driver mixes the string ... How do I build the string properly?
>
>Thanks in advance.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform