Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Run-time error '3708': Parameter object is improperly defined. Incons

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I am getting this error and don't know what is causing it.
"Run-time error '3708': Parameter object is improperly defined. Inconsistent or incomplete information was provided".

Here is the code:

Private Sub Command1_Click()

Dim Con As ADODB.Connection
Dim cmdId As ADODB.Command
Dim prmId As ADODB.Parameter
Dim rsMgs As ADODB.Recordset
Dim strID As String

Set Con = New ADODB.Connection

Con.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=a12;Password=a12;Data Source=m3"
Con.Open

Set cmdMgrId = New ADODB.Command
cmdId.CommandText = "proc_j"
cmdId.CommandType = adCmdStoredProc


mgrID = Trim(InputBox("Enter ID:"))
Set prmId = cmdId.CreateParameter("ID", adVarChar, adParamInput)
'ID is the IN parameter in the stored proc proc_j


cmdId.Parameters.Append prmId
prmId.Value = strID

Set cmdId.ActiveConnection = Con
cmdId.execute
End Sub
 
Try specifying the length of the input parameter in the optional size parameter to CreateParameter. Use something like this...

Set prmId = cmdId.CreateParameter("ID", adVarChar, adParamInput, Len(mgrID), mgrID)



Net_Giant

What fun is a technology if you can't crash the OS?
 
Tried and still same error. Error is popping up when code reaches at line
cmdId.Parameters.Append prmId


 
Try setting the ActiveConnection property before appending the parameter.


Net_Giant

What fun is a technology if you can't crash the OS?
 
Can you post the procedure declaration (not the code, just the name and parameter list stuff).


Net_Giant

What fun is a technology if you can't crash the OS?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top