Hi all, thanks for all your help over the last month - hate to say that im still stuck with this SQL string...
I have a string variable called RespCode that I need to use in a SQL string,
_________________________________
SELECT Contact_Table.RESPCODE
FROM Contact_Table
WHERE (((Contact_Table.RESPCODE) Like '*" & strRespCode & "*' ));"
_________________________________
as you can see, in the string i need to concanate strRespCode with two * delimiters -- i.e the Like clause becomes *002* (where 002 is RespCode)
When I execute the query I always get a null recordset!! Ive tried using single quotes, and double quotes around the Like Clause -- still no luck.
what puzzles me is that when I paste the runTime SQL string into an access query -- it works fine??
What is the query not executing when built dynamically??
Thanks
Hj
)
I have a string variable called RespCode that I need to use in a SQL string,
_________________________________
SELECT Contact_Table.RESPCODE
FROM Contact_Table
WHERE (((Contact_Table.RESPCODE) Like '*" & strRespCode & "*' ));"
_________________________________
as you can see, in the string i need to concanate strRespCode with two * delimiters -- i.e the Like clause becomes *002* (where 002 is RespCode)
When I execute the query I always get a null recordset!! Ive tried using single quotes, and double quotes around the Like Clause -- still no luck.
what puzzles me is that when I paste the runTime SQL string into an access query -- it works fine??
What is the query not executing when built dynamically??
Thanks
Hj
)