Command String

lothos12345

Well-known member
Joined
May 2, 2002
Messages
294
Location
Texas
I have a Visual Basic.Net application and for the data interface I am using Access I am feeding it a command string as follows:

VarTemp = "SELECT IFIELD1, IFIELD2, IFIELD3, IFIELD4, IMAGELIST, IDNUM FROM INDEXDB1 WHERE (IFIELD1 LIKE BN*) OR (IFIELD1 LIKE BR*) OR (IFIELD1 LIKE ES*) OR (IFIELD1 LIKE IG*) OR (IFIELD1 LIKE WZ*)"


This always returns nothing however when I put this same string in an Access query it returns what I expect it to return.

Also from the application when I feed it the sql command:

VarTemp = "SELECT IFIELD1, IFIELD2, IFIELD3, IFIELD4, IMAGELIST, IDNUM FROM INDEXDB1"

It works as expected too. The issue I have is when I use the where clause and only when I use it from the program. There is something wrong with how I am feeding the where clause from the program though I am not sure what. Any help offered is greatly appreciated.
 
Hi,
have you tried to change the * to a %
In my experience it has made a difference in some cases.
% is the standardSQL wildcard token, M$ took what you use in DOS and used it within Access to "help" people.
* is standardSQL token for "all fields" as in select * from Names

HTH
/Kejpa
 
Back
Top