LIKE not working for Access Query in ASP.NET 2.0

  • Thread starter Thread starter Anthony Bollinger
  • Start date Start date
A

Anthony Bollinger

I don't know if this is the best group to ask this question, so redirect me
if necessary. I have a valid query that uses the LIKE operator. I know it
is valid because it works directly in Access. I also know that my ASP code
is valid, because if I remove the LIKE operator, it works fine. Can anyone
tell me why the LIKE operator will not work for an Access database when sent
from ASP.NET 2.0?

Many thanks,
Tony
 
I don't know if this is the best group to ask this question, so redirect me
if necessary. I have a valid query that uses the LIKE operator. I know it
is valid because it works directly in Access. I also know that my ASP code
is valid, because if I remove the LIKE operator, it works fine. Can anyone
tell me why the LIKE operator will not work for an Access database when sent
from ASP.NET 2.0?

Many thanks,
Tony

Exactly what "doesn't work"?
I think you use * and ? as wildcards. These are supported by Access
when used directly. When you use OleDb to send a query to Access, use
the standard SQL wildcards: % (instead of *) and _ (instead of ?).

Hans Kesting
 
Hans Kesting said:
Exactly what "doesn't work"?
I think you use * and ? as wildcards. These are supported by Access when
used directly. When you use OleDb to send a query to Access, use the
standard SQL wildcards: % (instead of *) and _ (instead of ?).

Sorry I didn't describe the situation more. I receive no error message,
just an empty dataset.

Anyway, the wildcard situation did it for me, changing to %. Strange, it
will pass VBA functions straight through to Access/Jet, but not the
wildcards.

Anyway, thanks a million,
Tony
 
Back
Top