Wildcards in Access 2000 Module

RogerB

Registered User.
Local time
Today, 03:09
Joined
May 25, 2000
Messages
10
I can't get the "*" wildcard to work in Access 2000.

My code is:

strSql = "SELECT * FROM DigitalAssets WHERE IRN Like '" & strIRN & "*';"

I've also tried :

strSql = "SELECT * FROM DigitalAssets WHERE IRN Like '" & strIRN & Chr(42) & "';"

Any suggestions?

Thanks

Roger
 
Roger,

If IRN is really a string field, then your first example
should work, providing that IRN starts with strIRN.

If it is "just" contained within IRN, then you need an extra
"*" after the first single-quote.

Wayne
 
Thanks Wayne,

It is a string field and it starts with strIRN.

I get the feeling Access 2000 doesn't like "*" as a wildcard.

I'm using it in a 97 database that is accessing a backend 2000 database through an OBDC connetion. The search works without the "*".

I've tried using it in a 2000 database connecting to the same backend database and I get an error message referring to the "*" character when I try to execute the code.

In the 2000 help it mentions something about VB Access projects using different wildcards and implies that the SQL Server wildcard characters are used.

I'll try and find out what they are and give them a go.

Roger
 
Roger,

A2000 "likes" the * as a wildcard, as does A97.

I don't know about ODBC. I'll research and keep watch on
this.

Let me know.
Wayne
 

Users who are viewing this thread

Back
Top Bottom