I would like to start by stating I am fairly new to vb, but do not hold that against me. I have been writing a little viewer program to extract data from an Access db and display it in a ListView control. I have created a set of buttons that change the sql query and call a function that loads the ListView and displays it. All that is working fine. Here comes the weird part....
I have added functionality to take the contents of a textbox box control and use it to put together a sql statement. Unfortunately, this is the part is not working. The code executes, but acts like it does not find any data that matches. Thinking the problem is due to my poorly written sql, I tried to write this query, although hard coded, in Access and was able to successfully execute it. I then got Access to show me the sql code and pasted it directly into my program.
sql = "SELECT modeldesc.ModelDescription, modeldesc.CertCode, certcode.Price " &
"FROM certcode INNER JOIN modeldesc ON certcode.CertCodeKey = modeldesc.CertCode " &
"WHERE (((modeldesc.ModelDescription) Like '*AMP*'));"
Same results... No errors, no messages, no data either.
If I remove the where clause it works like a champ.
Was hoping someone had a little insight on the problem here.
Thanks, Randy


Reply With Quote
