Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with sql query and searching access db like

Status
Not open for further replies.

gwrman

IS-IT--Management
Dec 20, 2005
94
CA
I have a DB that I am trying to wrtie a VBscript search code for. I cant getany records to returned, even when I put in a term that I KNOW is in there. It DOES when I use "=" but when I use "LIKE" i get no results. Is there something I must do with the DB (setting?), or with the cursor in my vbscript code to get this to work?
 
Access uses different wildcards to SQL, so in Access you query should be:

select * from table where field like "*substring*"

BDC.
 
Chris: It depends on how your connecting. At one point I can remember using nothing but *'s for MS Access. Now % works. I don't know if this is something that changed with newer OLEDB drivers or if it is an OLEDB vs ODBC thing. One of those things I always meant to try and never got around to :)

So it is possible that *'s will work in this situation, I just couldn't tell you defintively since I don't know what method/version requires *'s and what uses %'s.

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top