G
Guest
Server = SQL Server 2000sp3a
Client = Access 2000 SP3
I have a onClick event on a command button which runs a stored procedure.
docmd.runsql "exec sp_mySproc '" & me.cmbo1 & "', '" & me.cmbo2 & "'"
This results in the error:
2342 A RunSQL action requires an argument consisting of an SQL statement
I've tried typing out the actual thing in VBA, ie not passed from objects
but hard coded, but it still fails. I know the SQL is right because I can
msgbox it and copy the result into QA and run ok from there.
I have no problems running straight docmd.runsql "exec
sp_MySproc_No_Params", just as long as there are no parameter values expected.
Is this normal?
Should I be using this instead?:
Dim adoRST As ADODB.Recordset, adoCON As ADODB.Connection, strSQL As String
Set adoRST = New ADODB.Recordset
Set adoCON = CurrentProject.Connection
strSQL = "exec sp_mySproc '" & me.cmbo1 & "', '" & me.cmbo2 & "'"
adoRST.open strSQL, adoCon
Or is there a better way?
Thanks.
Steve'o
Client = Access 2000 SP3
I have a onClick event on a command button which runs a stored procedure.
docmd.runsql "exec sp_mySproc '" & me.cmbo1 & "', '" & me.cmbo2 & "'"
This results in the error:
2342 A RunSQL action requires an argument consisting of an SQL statement
I've tried typing out the actual thing in VBA, ie not passed from objects
but hard coded, but it still fails. I know the SQL is right because I can
msgbox it and copy the result into QA and run ok from there.
I have no problems running straight docmd.runsql "exec
sp_MySproc_No_Params", just as long as there are no parameter values expected.
Is this normal?
Should I be using this instead?:
Dim adoRST As ADODB.Recordset, adoCON As ADODB.Connection, strSQL As String
Set adoRST = New ADODB.Recordset
Set adoCON = CurrentProject.Connection
strSQL = "exec sp_mySproc '" & me.cmbo1 & "', '" & me.cmbo2 & "'"
adoRST.open strSQL, adoCon
Or is there a better way?
Thanks.
Steve'o