You can change the query dynamically by using query def before opening it.
I'm assuming that Basedata.mmes_number is your textbox that holds the value you want to pass to the stored procedure.
Dim db As DAO.Database
Dim qry As DAO.QueryDef
Set db = CurrentDb
Set qry =...
I've tried both of these things (cast and another variable) and I get the same error.
Syntax error converting the nvarchar value 'Select appid from appsecurity.dbo.secapp where d095 = 1' to a column of data type int.
Can I use an output variable with in a stored procedure somehow?
I am trying to insert the result of a dynamic SQL query into a table. I need to convert the result to int but my code is trying to convert the dynamic SQL string to int (i.e. error converting 'select appid...') instead of the value returned by the query.
declare @fieldnm nvarchar(5), @value...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.