hk_vic Newbie
Joined: 05 Apr 2006 Posts: 3
|
Posted: Apr 26th, 2006 09:12 AM Post subject: Problem of database date format |
|
|
My program use M$ Access 2000 file (.dts) as the database.
And use the M$ ADO Data Control 6.0 (SP6) OLEDB to connect to the database
The connection string is as follow
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SYSTEM_PATH & "test\test.dts;Persist Security Info=False"
When I try to use the following SQL statment
"select * from table1 where date = #" & selectedDate & "# "
to select data in the database ("selectedDate" is the date value from the MonthView component in VB).
I discovered that the database can only recognize the "selectedDate" correctly in the format of "MM/dd/yyyy".
If the date format of WinXP is set to "dd/MM/yyyy" and the date is 1/6/2006 (ie 1st June, 2006), the database will wrongly recognize the date as 6/1/2006 (ie 6th Jan,2006).
How can the database always follow the WinXP date format setting??
I also want to know if all the language version of Access 2000 only recognize the date format in "MM/dd/yyyy" or not.
Thanks~~~ |
|