|
-
Mar 21st, 2002, 05:57 AM
#1
Using SQL Wildcards With ADO
Having recently tried to use wildcards in SQL statements with ADO, I realised I had a problem.
Thanks to this forum I found out that the wildcards have different characters for use in ADO than in MS Access.
Instead of using * you should use % with ADO.
Also, instead of using ? you should use _ with ADO.
You can use a whole host of other wilcard characters, such as [A-D] (meaning a letter from A to D). This works just the same in ADO as MS Access.
What I want to know is if there are any other changes, any other wildcards which are different from ADO to MS Access.
Please can people list wildcards I have missed, and their relevant characters for use with ADO.
For some reason this information doesnt seem to be documented anywhere other than this forum!
-
Mar 21st, 2002, 08:59 AM
#2
That's just about what I know.
(also helping u bump ur post in case there are more, but I seriously doubt that)
-
Mar 22nd, 2002, 04:29 AM
#3
Since posting this, I have found that:
# works in ADO just as it does in MS Access - meaning a single number.
Also, [!a-d] works in ADO as it does in MS Access, meaning not a - d.
Lastly, I am having problems running wilcard searches in getting illegal operation errors. This mainly happens when I am running a Like 'string with wildcard' search where my wildcard is wrong (e.g * instead of %), but sometimes I am getting illegal operations using the correct wildcards.
Can anyone help with this problem?
-
Mar 22nd, 2002, 04:39 AM
#4
just a hunch, but a ' (single quote) in your queries can cause problems too.
so you use a function replace(stringname,"'","''")
or what EXACT statement do you get the problem at?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|