Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...