Solved

Saving dates older than 1752 using ADO to MS Access?

Posted on 2002-07-05
9
177 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
ID: 7133238
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
ID: 7133251
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
ID: 7133355
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
ID: 7133359
Optionally, you could use dateserial function and save the date as double and do the conversion outside db. Just a guess.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:yongyih
ID: 7133968
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
ID: 7133973
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
ID: 7138322
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
ID: 7138361
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
ID: 7247269
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 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

20 Experts available now in Live!

Get 1:1 Help Now