• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

ADO with Access 2003 Database Issue

I am trying to pull data from an Access 2003 database using ADO and vb.net. For some reason, my query does not return any results when I send it programmatically, but when I use the exact same query in the Access query designer it works fine. The issue has to do with the LIKE condition in my WHERE clause.

Here is my query:

SELECT IndexNumber, Manufacturer, Model, SerialNumber, ItemNumber, Description " _
& "FROM Inventory " _
& "WHERE ProductCondition= 'New' " _
& "AND DateDelivered= #12/30/1899# " _
& "AND Manufacturer= '" & Manufacturer & "' " _
& "AND Model LIKE '*" & Model & "*' " _
& "ORDER BY Manufacturer, Model, SerialNumber"

Manufacturer and Model are string variables.


The problem is definitely with the LIKE condition because when I remove the * symbols it works fine. For example, if Model = 'Airplane' it will return everything where the Model is Airplane, but if Model = '*plane*' then it returns nothing. I have tried exchanging the * wildcard symbol for % and for ? but I still get no results back.

Does anyone know how to fix this issue? If you need more details then let me know.
 
Originally posted by: Xavier434
Originally posted by: KLin
Try using % instead of *

I tried. That doesn't work. I believe % is the wildcard for a sql server and not an Access database.

Using VC++ I have no issues getting to Access using the % as the wildcard for a text string retrieval.

 
Back
Top