Friday, March 23, 2012

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

Steveuse convert(datetime,variable,formattype) for your variables to first convert them into datetime format and then insert.|||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.|||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?|||Convert is a function in SQL server , not in VB ... use this function in your insert query.|||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?|||ah hah...

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

Cheers

No comments:

Post a Comment