Hi there,
I would like to call a stored proc from VBA. I would need to pass it a parameter.
What code would i use?
Thanks
*This post is locked for comments
Hi there,
I would like to call a stored proc from VBA. I would need to pass it a parameter.
What code would i use?
Thanks
*This post is locked for comments
Hello Jo Wykerd,
You can use the below code to call Stored procedure from VBA code.
If your SQL stored procedure returns Select statement, you can use the below code.
Dim SQLStr as String
SQLStr = “EXEC ProcedureName” & SParm (paramater1) & "," & SParm (Parameter1) & "," & DParm (Parameter3)
serr1 = SqlFetch1 (c7, SQLStr, bbufferName, LenB (bbufferName))
Call SqlFree (c7)
If your SQL stored procedure does not return any Select statement, you can use the below code.
Dim SQLStr as String
SQLStr = “EXEC ProcedureName” & SParm (paramater1) & "," & SParm (Parameter1) & "," & DParm (Parameter3)
Call Sql (c7, SQLStr)
Call SqlFree (c7)
Hope this explains.