Results 1 to 2 of 2

Thread: Setting up Parameters

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    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

  2. #2
    Member
    Join Date
    Jan 1999
    Location
    Garden Grove, CA, Orange
    Posts
    55

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width