Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting

Post new topic   Reply to topic
Problem of database date format
View previous topic :: View next topic  
Author Message
hk_vic
Newbie


Joined: 05 Apr 2006
Posts: 3

PostPosted: Apr 26th, 2006 09:12 AM    Post subject: Problem of database date format Reply with quote

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~~~
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic