what is the escape char to be used in access queries ?

  • Thread starter Thread starter Guest
  • Start date Start date
You can't specify an escape In access SQL, you stuck using the "*".

And how this works depends on how you are accessing the data.

Are using ADO to connect to a table, or are you doing this inside of MS
access?

The wildcard character in MS access is the * (asterisk) (normllay dao), and
then % (ado).

If you don't turn on the sql ansi extensions (SQL compatibility mode), then
% will not work in the query builder at all.
(unless you're executing ado quireis in code).

For MS access I suggest that you do not turn on the ANSI extensions.

So, now the question beomces, how do you seach for an * in a string?

You can use pattern matching.

apple*

to find anything that ends in a "*", wcould match the first part va

*, and the 2nd part with [*] (the square brackets means literal)

Hence, we get

like "*[*]"

The brackets force a literal match for ONE character.

And for a string that starts with an asterisk we get

like "[*]*"

How to find a *anywhere in the string?

I think you have to resort to using a function

eg:

where instr([fieldname],"*") > 0

So the wildcard character is normally *, and we can't "escape" it to
somthing else like in most sql systems.
 
Back
Top