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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO, SQL and the like statement 1

Status
Not open for further replies.
Mar 25, 2003
34
0
0
GB
Using ado from excel to execute sql statements against an access db. I have a problem when using the "like" statement though, as it never returns any data. Even though if i paste the same sql into the query builder it returns data. i've tried diff wild card characters ... anyone help????

sql statement similar to:
"WHERE ((tblData.Store) " & "Like " & Chr(34) & YaxisArray(i) & "*" & Chr(34) & ")"
...
WHERE ((tblDATA.Store) Like "STRING*")
 

Code:
"WHERE ((tblData.Store) Like '" & YaxisArray(i) & "*')"


Skip,
[sub]
[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue][/sub]
 
Thanks for the reply, but I tried that, it doesn't work either. Using Chr(34) was just a different way of enclosing in quotes.
 


Chr(39) then NOT 34!



Skip,
[sub]
[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue][/sub]
 
ADO syntax:[tt]
"WHERE tblData.Store Like '" & YaxisArray(i) & "%'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
As PHV said,

Access uses "*" for wildcard

ADO uses "%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top