Y2K Test for VB5 and 6

By | 2002-06-01

This program test the Visual Basic program you are currently running. As you will see.

Original Author: Preston Smith

Assumptions

You can adjust the dates for Jan 1st 1930, Jan 1st 2029, Jan 1st 00 and Feb 29 or 30 2000. To see if your version is compliant then you should use 1/1/00 for the year 2000, and 2/29/00 for the Leap Year date (this will cause a run-time error, if NOT compliant). I made a big mistake before, the date regarding the leap year, should not cause a run time error if it is compliant.

Side Effects

If you set up the code to check for the leap year date you should have a run-time error. If you do NOT have an error that is good. If you actually see a date then your version of VB is not compliant with Y2K. The updates and patches may be available at microsoft’s MSDN websight. Problems? Get the SP3 updates, Go here (VB6): http://msdn.microsoft.com/vstudio/sp/default.asp Go here (VB5): http://msdn.microsoft.com/vstudio/sp/vs97/default.asp

Code

Sub Form_Load()
Dim MyDate as Date
MyDate = "1/1/00" 'Or
'MyDate = "1/1/29" 'Returns 1/1/2029
'MyDate = "1/1/30" 'Returns 1/1/1930
'MyDate = "2/29/00" 'The Leap Year Date (Usually causes the most probs)
MsgBox Format(MyDate, "mm/dd/yyyy")
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.