J
Joe Delphi
Hi,
I am getting this error message: "Procedure SELECT_TPRD expects
parameter @TPRD which was not supplied"
My code is below. The error mesage and program failure happens on the
Parameters.Refresh line.
The problem is that my stored proc has a parameter @TPRD but it is an
OUTPUT parameter and is declared as such in the stored procedure. Why does
MS Access think it is an input parameter? Anyone know how to get around
this error message?
Any help appreciated.
JD
-----------------
Function SelectTprd(Optional newval As Variant) As String
Dim cmdCommand As ADODB.Command
Dim prmTPRD As ADODB.Parameter
Set cmdCommand = New ADODB.Command
cmdCommand.ActiveConnection = CurrentProject.AccessConnection
cmdCommand.CommandType = adCmdStoredProc
cmdCommand.CommandText = "[ad\jmuseck].SELECT_TPRD"
cmdCommand.Parameters.Refresh
Set prmTPRD = cmdCommand.CreateParameter("@TPRD", adChar, adParamOutput, ,
"")
cmdCommand.Execute
'Return the time period to the calling program.'
SelectTprd = cmdCommand.Parameters(1).Value
Set cmdCommand = Nothing 'Free memory End Function
I am getting this error message: "Procedure SELECT_TPRD expects
parameter @TPRD which was not supplied"
My code is below. The error mesage and program failure happens on the
Parameters.Refresh line.
The problem is that my stored proc has a parameter @TPRD but it is an
OUTPUT parameter and is declared as such in the stored procedure. Why does
MS Access think it is an input parameter? Anyone know how to get around
this error message?
Any help appreciated.
JD
-----------------
Function SelectTprd(Optional newval As Variant) As String
Dim cmdCommand As ADODB.Command
Dim prmTPRD As ADODB.Parameter
Set cmdCommand = New ADODB.Command
cmdCommand.ActiveConnection = CurrentProject.AccessConnection
cmdCommand.CommandType = adCmdStoredProc
cmdCommand.CommandText = "[ad\jmuseck].SELECT_TPRD"
cmdCommand.Parameters.Refresh
Set prmTPRD = cmdCommand.CreateParameter("@TPRD", adChar, adParamOutput, ,
"")
cmdCommand.Execute
'Return the time period to the calling program.'
SelectTprd = cmdCommand.Parameters(1).Value
Set cmdCommand = Nothing 'Free memory End Function