lothos12345 Posted August 23, 2006 Posted August 23, 2006 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. Quote
kejpa Posted August 24, 2006 Posted August 24, 2006 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.