Forum Moderators: open

Message Too Old, No Replies

IIS 5.0 Invalid Date Format

Error returned from ASP

         

The_Janster

2:40 pm on Oct 1, 2003 (gmt 0)

10+ Year Member



I have a very confusing (well for me it is anyway!) error .. here's the background:
Installed 2000 and IIS 5.0 onto new server and then configured our legacy application (very old uses Powerbuiler and ASP). Copied the existing Oracle 7.3.4 (I know - don't remind me it's so old it's not supported anymore!) database to a test instance.
The application 'builds' reports for periods you select from an available data screen.
The problem is that I can get reports out on data added through the new application install but get an invalid date format error when I try to run reports on data added through old application install.
I can run sql queries on the old data and it all looks fine.

Any help will be very gratefully received.
TIA
Jan.

duckhunter

2:17 am on Oct 3, 2003 (gmt 0)

10+ Year Member



Try reading the old data values into a DateTime variable then updating the row. Possible the format of a long/short date changed on you somehow.

Dim dtVar
Dim lngID

While not rs.EOF
lngID = rs.Fields("ID")
dtVar = FormatDateTime(rs.field("yourdatefield"), vbShortDate)
sql = "UPDATE TABLE SET DateField = '" & dtVar & "' where IdentityColumn = " & lngID
dbConnection.Execute sql
rs.movenext
Loop

JuniorHarris

4:39 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



I had a similar problem with short/long dates after upgrading from NT 4.0 to WIN2K. The ASP code worked fine on NT 4.0, but generated numerous invalid date errors on WIN2K. To get the app up and running as quickly as possible, I simply modified the default date format on the WIN2K server and this fixed the problem. At least until I could modify the code.

In my case, I believe it was specifically the short date format which caused the problem. I don't remember right off hand, but I believe I changed the format from M/d/yyyy to MM/dd/yyyy. This was done on the server through the regional options applet in the control panel.

Zaphod Beeblebrox

10:15 am on Oct 8, 2003 (gmt 0)

10+ Year Member



Databases generally use the american notation while in ASP you can use the Session.LCID variable to set regional settings to be used by ASP.

Maybe your ISS is using another version than your database?

The_Janster

10:34 am on Oct 8, 2003 (gmt 0)

10+ Year Member



It turned out to be a registry setting HKEY_USERS .DEFAULT Control Panel International iDate
was set to "1" (D-M-Y) I change this to "0" (M-D-Y) and all is now working okay.
Thanks for the help :o)

abulhallaj

8:53 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



use this code

Session.LCID=1033