On the execute statement, I get "No value given for one or more
parameters".
Here's the code and Stored procedure definition. They are not very
complicated and yet I can't seem to figure this one out. Any
suggestions?
Thanks for your help!
------------------------------------
Function ADO_CallSP()
Dim strConn As String
Dim strCMD As String
Dim oConn As New ADODB.Connection
Dim cmdCommand As New ADODB.Command
Dim rsADO As New ADODB.Recordset
Dim intIndex As Integer
' define the connection settings to the server strConn =
gblConnectionString
' create and open a connection to the server Set oConn = New
ADODB.Connection With oConn
.ConnectionString = strConn
.CursorLocation = adUseServer
.Mode = adModeRead
.Open
End With
'define the command to be sent to the server
strCMD = "BEGIN CALL CGA_CLIENT_PKG.VALIDATE_CGANUMBER(?,?,?); end;"
' create the command and it's provide it's settings Set cmdCommand =
New ADODB.Command With cmdCommand
.ActiveConnection = oConn
.CommandText = strCMD
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("p_cga_user_id", adVarChar,
adParamInput, 20, 450702)
.Parameters.Append .CreateParameter("p_user_count", adNumeric,
adParamOutput)
.Parameters.Append .CreateParameter("p_registered", adVarChar,
adParamOutput, 1)
End With
'execute the command
Set rsADO = cmdCommand.Execute <----------------this is where I get
the error message
'show the parameters
For intIndex = 0 To cmdCommand.Parameters.Count - 1
Debug.Print cmdCommand.Parameters(intIndex).Name,
cmdCommand.Parameters(intIndex).Value
Next intIndex
'show the fields in the result set
For intIndex = 0 To rsADO.Fields.Count - 1
Debug.Print rsADO.Fields(intIndex).Name,
rsADO.Fields(intIndex).Value
Next intIndex
'clean up
If Not rsADO.EOF Then
rsADO.Close
oConn.Close
End If
Exit Function
The Stored Procedure looks like this:
PROCEDURE Validate_CGANumber
(
p_cga_number IN InterCGA.CGA_User.CGA_Member_Number%TYPE, <------
VARCHAR20
p_user_count OUT NUMBER,
p_registered OUT InterCGA.RAW_CGA_DATA.HAS_REGISTERED%TYPE
<--------CHAR(1 BYTE)
);