ADO with Access Date/Time field not storing the time, just the date

ADO with Access Date/Time field not storing the time, just the date

Post by Steve Mat » Tue, 09 Oct 2001 19:54:21



Hi,

I'm using VB 6 and ADO to add records to a table. The table
has a Date/Time field.

All works fine, except that when I insert the record, ONLY
the Date is being stored..

e.g. If I use a value such as  #01-Mar-2001 12:34# then
after the update, I look in the table and it has been
saved as 01-Mar-2001.  My ADODB.Parameter object DOES have
the time stored when I Execute the Insert().

I've tried CDbl()'ing the Date but still no good...

I'm sure this worked fine with Access 97 a few weeks ago...

Any ideas?

Thanks,

Steve.

 
 
 

ADO with Access Date/Time field not storing the time, just the date

Post by Steve Lia » Wed, 10 Oct 2001 11:50:47


If using Now() does it work?

 
 
 

ADO with Access Date/Time field not storing the time, just the date

Post by Steve Mat » Wed, 10 Oct 2001 16:43:17



> If using Now() does it work?

Unfortunately no, but I have managed to solve the problem
(this appears to be peculiar to Office 2000?)

I changed the type in my CreateParameter() to
adDBTimeStamp instead of adDate  and it worked fine.

Using adDate worked fine on an identical installation
with Office 97, but failed with Office 2000

Bizarre..

Steve.

 
 
 

ADO with Access Date/Time field not storing the time, just the date

Post by Steve Mat » Thu, 11 Oct 2001 00:47:26


Solved it. I had installed Office 2000 AFTER MDAC 2.6. I re-installed
MDAC 2.6 and all is fine...

Steve.