Solved

Saving dates older than 1752 using ADO to MS Access?

Posted on 2002-07-05
9
176 Views
Last Modified: 2008-02-01
Hello experts,

I am using ADO to save a recordset to an MS Access database. I cant save a any date older than 01/01/1753. I realize this is when the Gregorian calander kicked in.

My code looks like:
rsADO.addnew
rsADO(lcounter - 1) = CDate(strout)

The error when strout is older than 01/01/1753
[Microsoft][ODBC Microsoft Access Driver]Datetime field overflow (null)

Help. I'm stuck.
JAmott
0
Comment
Question by:JAmott
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Please maintain your open questions:

Questions Asked 8
Last 10 Grades Given A C A  
Question Grading Record 3 Answers Graded / 3 Answers Received

Thanks,
Anthony
0
 
LVL 2

Expert Comment

by:yongyih
Comment Utility
Do you try to set the format of your date field in MS Access or regional setting (date tab) in control panel?

I am not sure can solve your problem or not..  but you can try.. good luck. ^_^
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Sorry, ADO filed supports since December 30, 1899
In other hand, if you could define the field as adDBDate, it APPEARS to supports any date (A date value (yyyymmdd) (DBTYPE_DBDATE))
Hope it helps
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Optionally, you could use dateserial function and save the date as double and do the conversion outside db. Just a guess.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 2

Expert Comment

by:yongyih
Comment Utility
How about save your data as string with fixed format?
for example dd/mm/yyyy format, 01/01/1753 save as 01011753 or 01/01/1753.

Then you know first two character represent day, last for characters represent year.

But if you do like this, you will have problem when comparing the date using SQL statement. ^_^
0
 
LVL 2

Expert Comment

by:yongyih
Comment Utility
or may be you can use some SQL command to convert it to date when you need to compare date in sql statement.

0
 

Author Comment

by:JAmott
Comment Utility
Thanks for you suggestions experts. As it turns out, this is a documented bug with the MS Access ODBC Driver. Check out this link:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q252699

I found out through a friend of mine. Can you beleive this bug still exists? Microsoft eh.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Please maintain this open question:
passing info from an ACTIVEX Document to a servside ASP page Date: 02/19/2002 09:46AM PST
http://www.experts-exchange.com/visualbasic/Q_20268655.html

Please delete these open questions, since no solutions were offered:
Setting file SHARE property via VB Date: 03/04/2002 02:10PM PST
http://www.experts-exchange.com/visualbasic/Q_20273201.html
How to open and access an ACT! database from VB Date: 02/26/2002 01:26PM PST
http://www.experts-exchange.com/visualbasic/Q_20271337.html
MS Access unicode WITH COMPRESSION Date: 02/10/2002 02:15PM PST
http://www.experts-exchange.com/visualbasic/Q_20265308.html

Thanks,
Anthony
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 100 total points
Comment Utility
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now