adDate parameter to stored proc.

Discussion in 'ASP General' started by Agoston Bejo, Dec 30, 2004.

  1. Agoston Bejo

    Agoston Bejo Guest

    Hi!
    I am trying to pass a VBScript Date variable as value to an ADO adDate
    parameter of a stored procedure (which runs in an SQL Server).
    If I add the parameter like this:

    oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate,
    adParamInput, , dParam)

    where oCmd is of type ADODB.Command and dParam is a VBScript variable of
    type Date
    then when trying to execute the stored procedure I get the following error:

    Optional feature not implemented

    I was able to get round this by passing a string value in an adVarChar
    parameter, but it would be easier and more readable with adDate and
    Date-type variables. Is this latter possible?

    Thx,
    Agoston
     
    Agoston Bejo, Dec 30, 2004
    #1
    1. Advertising

  2. Agoston Bejo wrote:
    > Hi!
    > I am trying to pass a VBScript Date variable as value to an ADO adDate
    > parameter of a stored procedure (which runs in an SQL Server).
    > If I add the parameter like this:
    >
    > oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate,
    > adParamInput, , dParam)
    >
    > where oCmd is of type ADODB.Command and dParam is a VBScript variable
    > of type Date
    > then when trying to execute the stored procedure I get the following
    > error:
    >
    > Optional feature not implemented
    >
    > I was able to get round this by passing a string value in an adVarChar
    > parameter, but it would be easier and more readable with adDate and
    > Date-type variables. Is this latter possible?
    >


    You need to use adDBTimestamp, not adDate.

    You might want to try out my stored procedure code generator available at
    http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear

    If your procedure has no output parameters, and you are not interested in
    retrieving the return parameter, you may want to consider using the
    stored-procedure-as-connection-method technique instead of the explicit
    Command object:

    http://tinyurl.com/jyy0

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Dec 30, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi
    Replies:
    3
    Views:
    1,993
    David Lozzi
    Jun 1, 2005
  2. NevilleDNZ
    Replies:
    9
    Views:
    462
    NevilleDNZ
    Aug 16, 2006
  3. jcpc
    Replies:
    2
    Views:
    1,569
  4. Jean-Hugues ROBERT

    Why no Proc##[]=() ? Why no Proc##replace() ?

    Jean-Hugues ROBERT, May 1, 2004, in forum: Ruby
    Replies:
    14
    Views:
    315
    Jean-Hugues ROBERT
    May 5, 2004
  5. Minkoo Seo

    Proc vs lambda vs proc

    Minkoo Seo, Feb 4, 2007, in forum: Ruby
    Replies:
    19
    Views:
    262
    Brian Candler
    Feb 6, 2007
Loading...

Share This Page