DateTime in Paramtized asp query?

Discussion in 'ASP General' started by Guest, Jul 8, 2005.

  1. Guest

    Guest Guest

    How does one paramtized a date in asp for a stored procedure that is
    expecting DateTime?


    if oRS.eof then
    '// SAFE TO INSERT STORY....

    CREATE Procedure spr_AddStory

    oCmd.Parameters.append oCmd.CreateParameter("StoryTitle", adVarChar,
    adParamInput,100,pStoryTitle)
    oCmd.Parameters.append oCmd.CreateParameter("StoryDate datetime,
    '//??????????????)

    Thanks
    Jason
    Guest, Jul 8, 2005
    #1
    1. Advertising

  2. wrote:
    > How does one paramtized a date in asp for a stored procedure that is
    > expecting DateTime?
    >
    >
    > if oRS.eof then
    > '// SAFE TO INSERT STORY....
    >
    > CREATE Procedure spr_AddStory
    >
    > oCmd.Parameters.append oCmd.CreateParameter("StoryTitle", adVarChar,
    > adParamInput,100,pStoryTitle)
    > oCmd.Parameters.append oCmd.CreateParameter("StoryDate datetime,
    > '//??????????????)
    >
    > Thanks
    > Jason


    The correct datatype constant is adDBTimeStamp.

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

    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], Jul 8, 2005
    #2
    1. Advertising

  3. wrote:
    > How does one paramtized a date in asp for a stored procedure that is
    > expecting DateTime?
    >
    > oCmd.Parameters.append oCmd.CreateParameter("StoryDate datetime,
    > '//??????????????)


    The complete list is here:
    http://msdn.microsoft.com/library/en-us/ado270/htm/mdcstdatatypeenum.asp



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Jul 8, 2005
    #3
    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. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    704
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    532
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    386
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    333
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    754
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page