If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

ACCESS 2003 SQL LIKE Operator not working in VB6 runtime

Hi All,

I am using VB6 script via ADO objects to read ACCESS 2003 backend database using SQL String LIKE Operator. It doesn't seem to be working. I tested the SQL string under ACCESS 2003 Query mode and it's OK but not in VB6 runtime. What the Sales Manager wanted is instead of keying in the complete 8 digits SalesOrder number he wants to key in only the first 3 digits and the SQL string will extract all transactions that matches the first 3 digits and display it in LISTVIEW CONTROL where he can select the specific line item. Please help me.

I only have Access 2002; but it works fine there. There is nothing wrong with the SQL string. Try checking your Connection and Recordset Objects. Make sure they are ok. Also you can do a Debug.Print of your SQL String, then copy and paste it directly into a new query in SQL View. Run it, and if there are no errors and it does what you want then your SQL string is fine.
Once you piece together your SQL string and send it to Access, it is Access that is executing it not VB. So if the Like operator is not working it is not VB, it must be your SQL syntax that Access does not like.