Hello Geof
You can use :
Set spMyProcedure = New ADODB.Command
With spMyProcedure
.CommandType = adCmdStoredProc
.CommandText = "spa_Proc"
Set .ActiveConnection = CurrentProject.Connection
.Parameters.Append .CreateParameter("@Param1",
adVarChar,adParamInput, 10)
.Parameters.Append .CreateParameter("@Param2",
adVarChar,adParamInput, 10)
.Parameters.Append .CreateParameter("@Param3",
adInteger,adParamInput)
.Parameters("@Param1") = strParam1
.Parameters("@Param2") = strParam2
.Parameters("@Param3") = intParam3
.Execute
End With
Or
Set spMyProcedure = New ADODB.Command
With spMyProcedure
.CommandType = adCmdStoredProc
.CommandText = "spa_Proc"
Set .ActiveConnection = CurrentProject.Connection
.Execute , Array(strParam1, strParam2, intParam3)
End With
Regards
--
Eva Etxebeste [MS MVP Access]
qqqq said:
Hi
Please can someone help?
I am trying to call a paramaterised stored procedure from VBA in a ADP.
All the info I can find on the net use ADO to make a connection, but surely
in a ADP u r already connected
Please can anyone assist.
Cheers
Geoff