Hi,
I am executing sql from VB to populate a form... (I'm building a search, so my code takes what the user inputs, queries the database, and then populates a table, to which the fields on my form are tied.)
The query runs fine (compiles and runs without throwing any errors). I can see in my "watch" in the debugger that the variable has the correct query text. But, when I open a new recordset with the query, I get no records.
To be sure it wasn't the sql, I copied my query into a query (sql view) and it executes just fine - 35 records.
the command is what you would expect:
where rst2 is the recordset (properly initialized, and showing up with everything correct in the watch), and stsql is the variable containing my sql query as a string. (showing up in source for rst2 in my watch, and running fine as a separate query). But no records in rst2.
I am concerned that it's something particular to my SQL syntax that won't work when passed/executed from VB:
-
"SELECT * FROM FullTable WHERE CodeA LIKE '*' & 'ABC' & '*'"
-
Any thoughts??
Thanks for your help!