Asked by:
AddNew() date problem

Question
-
User1854354681 posted
hello,
i have an app that was developed with classic ASP(VBScript). my regional language and settings is Romanian. i've copied the local settings to reserved accounts. the database is SQL 2000.
when i write this:
"insert into import_curs (data, valoare) select '06/09/2009', 1571.23 " it's ok. the month is 6, day 9.
but when i write this:
RS.Open "import_curs",Conn,3,3
RS.AddNew()
RS("data")="06/09/2009"
RS("valoare") = 1571.23
RS.UpdateBatch(adAffectAll)
RS.Closethe month is 9 and the day is 6. i really dont know what and where to change this behavior. i have to mention that this is working well in IIS 5.1, IIS 6.
thank you in advance.
Wednesday, June 17, 2009 5:17 AM
All replies
-
User1073881637 posted
This is a datatype issue between ADO and SQL Server. I'd try putting CDATE function around the date 'data'. Probably a newer version of ole-db causing the odd behavior. What do you see in sql profiler when the data is attempting to be written?
Thursday, June 18, 2009 7:49 PM -
User1854354681 posted
Hello,
thanks so much for answer, I did put a Cdate() but this didnt solves the problem. I still have this big big problem. If you can suggest anything else I would appreciate.
If I could somehow send you a 1 simple page application to demonstrate the behaviour maybe you will be able to submit a bug to the testers/developers team...
Thank you very much.
Friday, October 23, 2009 3:21 PM -
User-47214744 posted
The best thing you can do is if your data type in SQL is a date you should send a Date and not let some layer do the transformation from string to date since that can easily be impacted by locale of the servers, thread, api's, sql settings and many other factors that are not really bugs but just the right behavior.
Could you maybe use something like
RS("data")= DateSerial(2009, month, day)
Friday, October 23, 2009 4:16 PM -
User1854354681 posted
I know what I have to do...but in an application with over 2500 asp pages it's too late.
But this is not happening in IIS 4,5,6...
Friday, October 23, 2009 5:20 PM -
User1854354681 posted
Common people, please...there is really no one there that could resolv this bug in IIS 7?Friday, December 4, 2009 12:29 PM