ADO Parameter of The Wrong Type

Discussion in 'ASP General' started by Gargamel, Nov 6, 2003.

  1. Gargamel

    Gargamel Guest

    Hiya.

    I've taken over the development of a web app written in ASP. It's not
    very well coded. In the live environment it's fine, but on my local
    machine it falls over whenever it tries to pass a date to a SQL Server
    sproc. No idea why the person before me's been doing all this string
    formatting with his dates, but anyway, the error is:

    Application uses a value of the wrong type for the current operation.

    The dates throughout are in mmddyyyy format, and presumably ADO
    running on my local machine wants ddmmyyyy. I'm rebuilding the whole
    app in C#.Net anyway so I don't think it's worth me running through
    and making this jumble of code international date friendly, so my
    question is, where exactly is the date format for ADO defined?
    Windows? SQL Server?

    Thanks loads!

    Gargamel.
     
    Gargamel, Nov 6, 2003
    #1
    1. Advertising

  2. Gargamel

    Bob Barrows Guest

    Gargamel wrote:
    > Hiya.
    >
    > I've taken over the development of a web app written in ASP. It's not
    > very well coded. In the live environment it's fine, but on my local
    > machine it falls over whenever it tries to pass a date to a SQL Server
    > sproc. No idea why the person before me's been doing all this string
    > formatting with his dates, but anyway, the error is:
    >
    > Application uses a value of the wrong type for the current operation.
    >
    > The dates throughout are in mmddyyyy format, and presumably ADO
    > running on my local machine wants ddmmyyyy. I'm rebuilding the whole
    > app in C#.Net anyway so I don't think it's worth me running through
    > and making this jumble of code international date friendly, so my
    > question is, where exactly is the date format for ADO defined?
    > Windows? SQL Server?
    >
    > Thanks loads!
    >
    > Gargamel.


    http://www.aspfaq.com/show.asp?id=2040


    HTH,
    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, Nov 6, 2003
    #2
    1. Advertising

  3. Gargamel

    Ken Schaefer Guest

    Hi,

    It depends... :)

    Each user has their own settings, and ASP, IIS, and SQL Server can all be
    running under different user accounts (for an extreme example).

    If you are passing string literal dates via ADO to SQL Server, then the best
    format is yyyy/mm/dd (or some other version of ISO date formats that can be
    miscontrued). String literals need to be parsed by SQL Server, and converted
    to a valid date/time format.

    Cheers
    Ken



    "Gargamel" <> wrote in message
    news:...
    : Hiya.
    :
    : I've taken over the development of a web app written in ASP. It's not
    : very well coded. In the live environment it's fine, but on my local
    : machine it falls over whenever it tries to pass a date to a SQL Server
    : sproc. No idea why the person before me's been doing all this string
    : formatting with his dates, but anyway, the error is:
    :
    : Application uses a value of the wrong type for the current operation.
    :
    : The dates throughout are in mmddyyyy format, and presumably ADO
    : running on my local machine wants ddmmyyyy. I'm rebuilding the whole
    : app in C#.Net anyway so I don't think it's worth me running through
    : and making this jumble of code international date friendly, so my
    : question is, where exactly is the date format for ADO defined?
    : Windows? SQL Server?
    :
    : Thanks loads!
    :
    : Gargamel.
     
    Ken Schaefer, Nov 6, 2003
    #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. nita
    Replies:
    1
    Views:
    881
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    469
    Kevin Spencer
    Dec 17, 2004
  3. Replies:
    0
    Views:
    1,321
  4. jcpc
    Replies:
    2
    Views:
    1,487
  5. Navin
    Replies:
    1
    Views:
    710
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page