Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date format problem when database is uploaded

Status
Not open for further replies.

eljacobs

Programmer
Oct 13, 2003
47
GB
Hi

i have an access database that stores news articles and displays them in date order. The date is stored in a column with the datatype date/time and the format is short date.

when i enter a date through a web form, while the database/site are stored on my pc. it saves it in the correct uk format (dd/mm/yyyy) but when the database is uploaded to the remote server it starts saving the dates in US format (mm/dd/yyyy).

Is this because the regional settings on the remote server are set to US? is there a way that i can save the date settings in the database itself?

Thanks

Elliot
 
Hi

Try setting the locale ID

Code:
Session.LCID = '1033'

That may help......

Thanks


Glen
Conception | Execution
 
2057 is the LCID for the UK. 1033 is the US LCID

and it's numeric not a string so
Code:
session.LCID = 2057

LCID list




Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Thanks guys but the problem is not solved.

the problem is not that the page is displaying the date incorrectly as when i upload the database any dates already entered are displayed in the correct way. The problem is that when adding a new record or updating an existing one the date is saved in access incorrectly. So if i enter the date as 03/12/2004 in the input form it saves in the database as 12/03/2004.

adding the 'session.LCID = 2057' code won't change the date once it has been entered inccorectly into the databse.

Any ideas?

Thanks

Elliot
 
use the formatdate() method on the insert statement.

It doesnt matter which format the that is in in the database as long as it is valid. If it is valid then you can format it on the output.

Failing that in SQL server you can specify the date format as part of the SQL not sure about access though.....



Glen
Conception | Execution
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top