Alex_bg Posted March 1, 2005 Posted March 1, 2005 Hello all, I have problems when trying to update a date type field in a MS Access database with VB and ASP.NET OleDb.OleDbCommand. I am using the following update statement: Update [sMD plans] SET [Produced quantity]='123' WHERE (Product='345') and (shift='1') and (date=#02/01/2001#) Normally the date standart in my locale is dd.mm.yyyy, but if I send the date in this format to the database it returns an error. It accepts it only in format mm/dd/year. The database is on the same computer I am writing the code, and its default locale settings are for date format dd.mm.yyyy. Also I get the date in this format when I use DateTime.Now.ToShortDateString(). Because of this, when I want to update a date field, I have to make a special string operations to update my field. The culture property of my web page is set to BG-BG. Thanks, Aleksander Quote
kejpa Posted March 2, 2005 Posted March 2, 2005 Hi, Unless you use parameters for your updates you have to provide the dates the (US) standard way "mm/dd/yy". That's as localized as it gets. HTH /Kejpa Quote
Alex_bg Posted March 2, 2005 Author Posted March 2, 2005 Thanks, this completely answers my question. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.