Regional settings problem somewhere

Regarding the Problem with reversing the date / month of the date when saving

I also noted that even setting the Session.LCID on the page itself doesn't matter that it was.

How can the environment be such that between the test and the live asp site in real time the dates entered via SQL but not in the test are reversed.

Both have the UK IUSR suite, both have all users installed in the UK, both have a SQL account set to US English and both have the Session.LCID set to 3081 (Australian English)

Why does test run "insert '01 / 03/2008 'into datecolumn value and insert '01 / 03/2008' and live insert '03 / 01/2008 '"

The settings look completely identical. It must be clarified, soon I will be afraid that we will never know. The problem is that we cannot change the code or anything else. All I can do is investigate and tell them the reason. But I can't find it!

It's VB6 / ASP and it makes me lally.

The database is accessed through a system DSN configured to use the correct SQL account.

What additional information you might need.

0


source to share


2 answers


In SQL Server Management Studio, under Security - Logins, right-click the user you are connecting and click Properties. The bottom combo box is labeled "Default language", change it to "British English" (not just English).

sp_configure 'default language'

sets the default language for newly created logins and it is saved in sysconfigures

.



I am assuming the language is not specified in the query string?

+1


source


I recommend that you change the code that interacts with the database. There are two unambiguous date formats that can be used with SQL Server.

You can use yyyy-mm-ddThh: mi: ss.mmm or YYYYMMDD hh: mi: ss.mmm

SQL Server will never misinterpret dates if you use one of the two formats listed above.



In vb, you can use the following format function to format the date in a null date format that SQL Server will never misinterpret.

Format(YourDateVariable, "yyyymmdd hh:nn:ss")

      

0


source







All Articles