Using "like" from an external link

  • Thread starter Thread starter akadas
  • Start date Start date
A

akadas

Hi,

I am connecting into an Access 2007 database that I set up, and one of my queries uses the "like" keyword. The query runs fine within access but if I connect to it externally (say through ADO or something setting it up in my window's ODBC list) the same query returns nothing.

I checked the query without using wildcards in the "like" quote (such as *)and then the query worked as if I was using an "=" clause. Of course I do not want that.

Has anyone faced this issue before?

Thanks
 
Hi,

I am connecting into an Access 2007 database that I set up, and one
of my queries uses the "like" keyword. The query runs fine within
access but if I connect to it externally (say through ADO or
something setting it up in my window's ODBC list) the same query
returns nothing.

I checked the query without using wildcards in the "like" quote (such
as *) and then the query worked as if I was using an "=" clause. Of
course I do not want that.

Has anyone faced this issue before?

Thanks

Yep. External technologies, such as ADO, require ODBC wildcards (% and _
instead of * and ?) to be used in the queries sent to them. The provider
being used determines what it does with the wildcards in the query. In the
case of the Jet provider (or the ODBC driver for Jet) the wildcards are
replaced with the Jet wildcards before being passed to the databse engine.

Corollary: if you use an external technology to execute a Jet saved query
that contains wildcards, the same thing will occur. This one had me
scratching my head for quite some time.
 
Back
Top