|
-
Jul 26th, 2002, 08:36 AM
#1
Thread Starter
Junior Member
Access and ADO.NET HELP!
I am attempting to send a Date to a Date/Time field within an MS access database, however the time keeps getting cut off and only the date appears. Why is this?
The Date/Time field is set to general date and the information i'm sending to the MS Acess through adding a record is a date with the same format (the standard return of the Now() function).
Any ideas? THanks in advance.
Last edited by USpatriot; Jul 26th, 2002 at 10:05 AM.
-
Jul 26th, 2002, 11:14 AM
#2
Thread Starter
Junior Member
ahh!
No one knows anything about ADO.NET and Acess data relationships???
-
Jul 26th, 2002, 11:17 AM
#3
I do. CAn you show the code as when I write to access using an Insert statement it writes the full date and time as expected?
-
Jul 26th, 2002, 11:23 AM
#4
Thread Starter
Junior Member
woohoo
Here is a simplified version of my code:
I am using the NewRow() function to create a new record within the data base.
Dim DTreceived As Date = Now()
Dim drNew As System.Data.DataRow
drNew = Me.dataAll.Tables(0).NewRow()
drNew.Item("dateReceived") = DTreceived
Me.dataAll.Tables(0).Rows.Add(drNew)
The data type for the field "dateReceived" in Access is set to Date/Time with the format "General Date"
When the record is inserted into the database, the date appears as just MM/dd/yy for some reason, no time...
-
Jul 26th, 2002, 11:28 AM
#5
Dim DTreceived As Date = Now()
^^^ wrong
Dim DTreceived As DateTime = Now()
^^^correct
-
Jul 26th, 2002, 11:32 AM
#6
Thread Starter
Junior Member
I have already tried using DateTime, and just tried it again, same result...
Any ideas?
-
Jul 26th, 2002, 11:34 AM
#7
-
Jul 26th, 2002, 11:41 AM
#8
Thread Starter
Junior Member
One problem here... i have to update two tables with the exact same time... so a variable is required....
I also tried that earlier.
Have you tried it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|