Ask the MultiValued Visual Basic Expert - #9B

(as published in Spectrum magazine May/June 1998)

To email your questions to "Ask the MultiValued VB Expert", click here.
Copyright 1996-98 Caduceus Consulting. All rights reserved.

VB and the Year 2000

Not to be outdone by all the other hype, I felt that it was time this column made its own contribution to the good old Y2K debate. Much has been said about the year 2000 within MultiValue applications. If you missed any of it, check out Lee Burstein's article (Sept/Oct 97 issue of Spectrum magazine) or the comp.databases.pick news group (see the Nov/Dec 97 discussion). So how about Visual Basic? Surely Microsoft got it right. Right? Read on…

Like all MultiValue flavors, the internal storage of dates in Visual Basic is done as an integer from a set date. For VB, day 0 = 30 December 1899, 68 years and 1 day prior to where Dick Pick started his. The real problem in Visual Basic is how two digit years are converted to their four digit equivalent, and that depends on what version (and release) of VB that you are talking about. As the releases approached the fateful deadline, the solutions(?) slowly improved, however with modularization, a new factor has been introduced. You now have to check not only what version the application was compiled under, but also what version of OleAut32.dll each workstation is using to run the code!

I have summarized this information in the 2 tables which follow.

Software being used

Behavior

Visual Basic 3.0 and prior versions Converts all two-digit years to the 1900s. [This is worse than any MultiValue box.]
Visual Basic 4.0 (16-bit) Converts all two-digit years to the century of the current system date. [Boy, who ever though THAT one up?]
Visual Basic 4.0 (32-bit) DateSerial function Converts all two-digit years to the century of the current system date.
All other date functions Converts two-digit years to four-digit years based on the default in the Automation libraries. (see table below) Note that VB4 first shipped with version 2.10 of OleAut32.dll.
Visual Basic 5.0 All date functions Converts two-digit years to four-digit years based on the default in the Automation libraries. (see table below) Note that VB5 first shipped with version 2.20.4054 of OleAut32.dll.

 

Version of OleAut32.dll

Behavior

Version 2.10 (as first shipped with VB4) Converts all two-digit years to the century of the current system date.
Version 2.20 and later Converts two-digit years to the 1900s if the two-digit year is between 30 and 99. If the two-digit year is between 00 and 29, the date is converted to the 2000s. [I guess someone let Microsoft know how Pick solved this problem many years ago!]

To email your questions to "Ask the MultiValued VB Expert", click here.
Copyright 1998 Caduceus Consulting. All rights reserved.
Compiled: May 6, 1998.

Return to Caduceus Consulting Home Page

Copyright 2006 intellact
Last modified: Thursday May 25, 2006