I am attempting, for the first time (well, more like 63rd time today...) to call an SQL Server stored procedure from Microsoft Access.
I started by copying code from Here's what I pulled in:
I am receiving the error "The Microsoft Jet database engine cannot find the input table or query 'dbo'."
I am assuming that I need to find a way to tell Access that it should be looking for that stored procedure on the SQL box (which is located at STLVS001\DA).
Question: how do I do that? I must be missing something obvious, as the code from the post above resolved that user's problem.
By the way, does anyone else find it particulary annoying that this Microsoft calls this "Run-time error '-2147217865'"? What's up with the negative numbering?
Thanks,
Paul
I started by copying code from Here's what I pulled in:
Code:
Private Sub cmdGo_Click()
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
Dim param1 As Parameter, param2 As Parameter, param3 As Parameter, param4 As Parameter
Dim begdate As Date
Dim enddate As Date
begdate = #10/1/2001#
enddate = #10/31/2001#
' Connect
Set cnn = CurrentProject.Connection
Set cmd.ActiveConnection = cnn
''Set param1 = cmd.CreateParameter("Input", adDBDate, adParamInput)
Set param1 = cmd.CreateParameter(, adDBDate, adParamInput)
cmd.Parameters.Append param1
param1.Value = begdate
Set param2 = cmd.CreateParameter("Input", adDBDate, adParamInput)
cmd.Parameters.Append param2
param2.Value = enddate
Set param3 = cmd.CreateParameter("Input", adSmallInt, adParamInput)
cmd.Parameters.Append param3
param3.Value = 3
Set param4 = cmd.CreateParameter("Input", adSmallInt, adParamInput)
cmd.Parameters.Append param4
param4.Value = 3
' Set up a command object for the stored procedure.
cmd.CommandText = "dbo.sp_PM_Test"
cmd.CommandType = adCmdStoredProc
' Execute command to run stored procedure
Set rst = cmd.Execute
End Sub
I am receiving the error "The Microsoft Jet database engine cannot find the input table or query 'dbo'."
I am assuming that I need to find a way to tell Access that it should be looking for that stored procedure on the SQL box (which is located at STLVS001\DA).
Question: how do I do that? I must be missing something obvious, as the code from the post above resolved that user's problem.
By the way, does anyone else find it particulary annoying that this Microsoft calls this "Run-time error '-2147217865'"? What's up with the negative numbering?
Thanks,
Paul