I am running a query on an Access table through VB with ADO. Basically I am looking for an occurance of an exclamation point (!) anywhere in a text field. So I use the SQL:
WHERE fieldname LIKE '%[!]%'
I have also tried:
WHERE fieldname LIKE '%!%'
Every other time I run the query, it pulls up all the records in the table. Then I run it again, it works right. When I run it again, it pulls up all the records in the table, etc....
Does anyone have any ideas? If I run this in the query editor in Access, it always works right, but then I have to use * instead of %. But through ADO, it doesn't recognize * as the wildcard.
Please help, any ideas will be appreciated.
Kevin
WHERE fieldname LIKE '%[!]%'
I have also tried:
WHERE fieldname LIKE '%!%'
Every other time I run the query, it pulls up all the records in the table. Then I run it again, it works right. When I run it again, it pulls up all the records in the table, etc....
Does anyone have any ideas? If I run this in the query editor in Access, it always works right, but then I have to use * instead of %. But through ADO, it doesn't recognize * as the wildcard.
Please help, any ideas will be appreciated.
Kevin