I am facing difficulties in having my code to execute a Oracle Stored Procedure which has one input parameter and two ref cursors as output parameters. One ref cursor will be pointing to Error message and codes, and the other will return the actual output records when there is a successful message in the error set. I m posting my code here. Please provide your inputs and suggestions. Thanks.

Set conConnection = CreateObject("ADODB.Connection")
Set cmdCommand = CreateObject("ADODB.Command")
Set rstRecordSet = CreateObject("ADODB.RecordSet")

conConnection.ConnectionString = "DRIVER={Microsoft ODBC for Oracle}; " & "SERVER=" & sDatabaseName & ";User ID=" & sUID & ";Password=" & sPWD & " ;"
conConnection.CursorLocation = adUseClient


With cmdCommand
.ActiveConnection = conConnection
.CommandText = "Stored Procedure Name"
.CommandType = 4
Set objParam = .CreateParameter("n_SegmentID",adNumeric,adParamIn put,22,220227)
.Parameters.Append objParam
End With

With rstRecordSet
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
End With

Set rstRecordSet = conCommand.Execute

'Looping to read the records

'Close the connection

'Release your variable references
Set conConnection = Nothing
Set cmdCommand = Nothing
Set rstRecordSet = Nothing

I am constantly getting an error message as "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" at line where we use "CreateParameter", I checked my DB for the field name and field type as found to be "Numeric(22)" datatype.

Do I need to Create output parameters for 2 output ref cursors? Please help me out. Thanks.