Results 1 to 4 of 4

Thread: Using SQL Wildcards With ADO

  1. #1
    rjpageuk
    Guest

    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!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    That's just about what I know.

    (also helping u bump ur post in case there are more, but I seriously doubt that)

  3. #3
    rjpageuk
    Guest
    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?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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
  •  



Click Here to Expand Forum to Full Width