VB Date to OleDB.DBTime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone tell me how to convert a the time portion of Date into OleDB.DBTime? My time field in Access is of type DBTime and I keep getting casting errors. I know that the DBTime is a TimeSpan but I can't seem to get it. Does anyone have any ideas how I can successfully write the time portion to my database through my DataAdapter?


Thanks,

Carlo.
 
Access/Jet supports the datetime data type, which includes both the
date and time portions of a date. This is stored as a double
internally, so a date of 1/1/2001 1 PM would be stored as
36892.5416666667. I don't know what your code looks like, so you may
need to play with it a bit to get a valid date portion as well as the
time. This is one compelling reason why most developers opt to store
time-only data as an integer, NOT datetime. HTH,

--Mary
 
Back
Top