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