Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Posts
    17

    Unanswered: Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

    Our SQL - INSERT INTO tbl_WAAGUsage (logindate,logintime,countryname,subscriberid,ipad dress) VALUES ('2/16/2004','9:50:01 AM','Albania',62,'123456789')

    Hi,

    I was wondering if somebody could help me... the following error message appears when I run an asp page... I did a google search and nobody appears to have had a solution to the particular problem I have... it's completely baffling but I'm hoping it's a simple setting.

    Firstly, I'm sure the coding the correct as the asp page runs on two different servers correctly. I recently got a new server and the script does not appear to work with the Date function in asp on this new server. I outputted the SQL to the browser and then ran it through the Query Analyser(QA) and guess what, it worked! But when I run the asp page the above error crops up... now when I run the SQL through QA and alter the date value in the format 'dd/mm/yyyy' the above error appears in QA.. if I've lost you at this point let me know...

    The way ASP passes the Date value to my SQL DB appears to be confused and it's really confusing me as it works perfectly on two servers and not the new one... the new server runs newer versions of O/S and SQL so I'm not sure that is the case... I've changed the date settings on the server so they all three servers match each other... so I have no where else to turn... any help and pointers would be much appreciated!

    Regards

    Steve

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    use convert(datetime,variable,formattype) for your variables to first convert them into datetime format and then insert.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Feb 2004
    Posts
    17
    ok... i'll try and see what the results are...

    thanks!

    Originally posted by Enigma
    use convert(datetime,variable,formattype) for your variables to first convert them into datetime format and then insert.

  4. #4
    Join Date
    Feb 2004
    Posts
    17
    I don't think there is a Conver() function in VBScript, however there is a FormatDateTime function which I used... didn't produce the results I wanted unfortunately, still comes up with an error... it's the case of the same code producing different results on different servers and my guess is there could be a setting to change on the servers... I'm trying to match up the settings and so far no luck...

    could you enlighten me?

  5. #5
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Convert is a function in SQL server , not in VB ... use this function in your insert query.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Two webservers make this page work, and the third one has problems? Have you checked (or had an admin check) the regional settings on the bad box?

  7. #7
    Join Date
    Feb 2004
    Posts
    17
    ah hah...

    I'm very enlightened!! Thanks alot for that... solves all my date problems now!!

    Cheers

Posting Permissions

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