LIKE not working for Access Query in ASP.NET 2.0

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
 
H

Hans Kesting

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
 
A

Anthony Bollinger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top