Hi!
I searched for this one with no results.
I have an Access table with a column Date_of_birth witch has date/time format like dd/mm/yyyy.
I develop a VB6 application that needs to read, write, update data in the mdb.
INSERT:
The user inserts this Date_of_birth in a textbox. I use this for inserting (I will write just the problem-part of the code):
a= Format$(Format$(txt_dateofbirth, "##/##/####"), "dd/mm/yyyy")
datacon.Execute ("" _
& "INSERT INTO MyTable (Date_of_birth) " _
& "VALUES (#" & a & "#)")
Then, for updating, I have a form witch ritrieves data into textboxes. A user can modify what is needed and then must press the UPDATE button.
a = Format$(Format$(Format(txt_dateofbirth.Text, "dd.mm.yyyy"), "##/##/####"), "dd/mm/yyyy")
[INDENT]'This is because a user can modify the date like dd.mm.yyyy or let it like dd/mm/yyyy (if this a format like the one in the INSERT part will result in smth like /03/8521)
[/INDENT]
datacon.Execute("" _
& "UPDATE MyTable "
& "SET Date_of_birth = #" & a & "# " _
& "WHERE Name = '" & ClientName & "'"
All the above works. But not OK. After UPDATE I want to see the results and... it switches the day and the month
insert: 05.10.2000
view: 05/10/2000
OK
update with: 05/10/2000
view: 10/05/2000
update again without modify
view: 05/10/2000
and so on. It keeps switching 05 and 10
BUT: If Inserts 18.05.2000
view: 18/05/2000
update without modify
view: 18/05/2000 THIS IS OK
What goes wrong?
IMPORTANT (maybe):
The computer I work has Win XP and Access both italian versions. I may run the program on english version. I need smth witch has nothing to do with regional options.
Any suggestion is highly appreciated.
Thx!