I need a pass through query (to a SQL table) in where I have declared a variable. I can run the query in Query Analyzer with a record returning, however as a pass through I get the message like 'Pass Through Query with ReturnRecords set to True did not return any records'.
I know I could do this as a StoredProcedure and then have the pass through 'exec sp_Name paramValue' but the sql statement is going to be generated in VBA depending on what is selected on a form.
The attached code is not the full statement I need, just testing if declare's worked
declare @ProjectID int
select @ProjectID = 6233
Select * From Project Where ProjectID = @ProjectID