views:

483

answers:

1

I am trying to migrate an old classic asp application to IIS 7.0 with win2k8 and I definately don't want to change the old code if I can help it.

I have set a date format in the Customise Regional Options in the Date formats in the regional and and language options in the control panel to dd-MMM-yy.

I am still getting Conversion_failed_when_converting_datetime_from_character_string errors using this date format even after reboots.

I am using also using SQL Server Express 2005.

Where else do you need to set date formats? Should they all be picked up from the machine setting?

The old code does something really dumb, but again I don't want to have to change it and then test it all again.

The old code effectively does this "Insert Into MyTable (ThisDate) Values ('" & Now() & "')"

Generates Insert Into MyTable (ThisDate) Values ('17/03/2009 3:40:48 p.m.')

Msg 241, Level 16, State 1, Line 1 Conversion failed when converting datetime from character string.

What it's ACTUALLY complaining about is the "p.m." part of the string dispite the Region settings on the machine specifying to NOT use this.

A: 

There is only one place you have to set it, for any application that pays attention to regional settings, and you've already set it there.

What is "Conversion_failed_when_converting_datetime_from_character_string" from? VBScript? Maybe it doesn't pay attention to regional settings.

John Saunders
Further investigation seems to indicate that it's coming from the DB.If I run it separately from IIS, in VB Script and paste it into adb window, it works. Seems to be something formatting Now() in VBScript wierdly.
GordyII
It appears that IIS is using the settings for the IUSR user. As it is difficult to login as this user, it is practically impossible to change the region settings.
GordyII