datetime - data mismatch using datetime.now

bbxrider

Registered User.
Local time
Today, 10:52
Joined
May 19, 2009
Messages
30
in access 2003, i created a date/time field, appDate, and set it to general date, which shows exactly as the rendered date below

then i try to update it with
Code:
Using command As New System.Data.OleDb.OleDbCommand("bapps3insert", db)
                'Set the commandtype  
                command.CommandType = Data.CommandType.StoredProcedure
                'Specify the parameters  
                Response.Write("datetime.now = " & DateTime.Now & "</br>")
                command.Parameters.AddWithValue("appDate", DateTime.Now)
                 etc.
I was following this tutorial, http://www.mikesdotnetting.com/Article/92/MS-Access-Date-and-Time-with-ASP.NET, which i thought indicated i could use the above syntax and date format

the response.write rendering of the date was "9/28/2009 2:32:11 PM" - just to be clear w/o the quotes


if i change the date variable to command.Parameters.AddWithValue("appDate", DateTime.Now.Date)
the update goes fine, however, as expected, i only get the date and no time, i want the access date field to include the time


it seems there is some incompatability with the vb.net datetime.now and access2003 date/time - general date, there is some way to get around this?
 
Think you need to redirect your question to the .net forum, where you may get a better response.

David
 
thanks, tried that, post sitting there for 2 days, no reply yet, so thought i'd try here. one question, is there any difference between the access2000 and 2003 for date time fields?
i have an app in traditional asp, that updates a date/time - general date with the built in variable, now(), that works ok, now() seems to be the same as datetime.now in vb.net
 
The data/time field has always remained the same throughout all versions as far as I am aware.

Date() is the integer part of the number
Time() equals the decimal part of the number
Now() is the integer and the decimal

therefore 0.0 = 31/12/1899 12:00:00 am


David
 

Users who are viewing this thread

Back
Top Bottom