V. Strange Date Storage Problem

tonywilliams

Member
Joined
Feb 12, 2007
Messages
9
Programming Experience
3-5
I am having the strangest experience with Date storage from VB.NET.

When I store a date such as 9 march 2007. It stores the date on the database as 3 september 2007. Which I concluded that means it is just recognising dd/mm/yy as mm/dd/yy. However, if i store 31 march 2007 it stores fine? I thought it would throw up an error message?

Can anyone tell me the best way to deal with dates when storing on the database. I want to work with UK dates, have I got something setup wrong?

Any help would be appreciated.
 
This is what happens when you dont use proper parameterized queries, and instead rely on the database's guess of how to convert the string you supplied, into a date.

Take a read of this thread:
http://www.vbdotnetforums.com/showthread.php?t=18517

Its for Oracle, but it highlights the important things. Dont try to convert that thread advice to Access; just read it to gain an appreciation of how parameterized queries should be done and why they work..

Then take a read of the DW2 link in my siignature, which demonstrates in incredible detail, how to do absolutely everything you could ever want to do with an access database, from retrieving data to performing transactional updates..
 
Back
Top