PDA

Click to See Complete Forum and Search --> : Setting up Parameters


preeti
Aug 5th, 1999, 07:47 PM
Hi,

I have a stored Procedure in Oracle8 that requires one parameter. From oracle the procedure works perfectly, but I cannot set up a parameter object from VB, or pass my parameter to the procedure.

Here is my code:
I set up my command object to my procedure

Dim adoPrmDate As ADODB.Parameter

Set adoPrmDate = adoCom.CreateParameter("vdatetime", adVarChar, adParamInput)
adoPrmDate.Value = Format(Now, "dd-mm-yyyy") & " 00:00:00"
adoCom.Parameters.Append adoPrmDate

When it goes to append the parameter object, it gives me back a run-time error 3708 The application has improperly defined a Parameter object.

I did exactly what was in the msdn library.

Is this way to pass a parameter to a stored procedure or is there another way?

Any help would be appreciated.

Thanks in advance,
Preeti

jpark
Aug 5th, 1999, 09:35 PM
Hi,

Since u use string type(adVarChar), I think u should set size of it.
Set adoPrmDate = adoCom.CreateParameter("vdatetime", adVarChar, adParamInput, 20)

,or try adDBTimeStamp instead of adVarChar without setting size.

I'm using SQL7.0, and it worked fine with above statements.

HTH
Joon