Solved

2000 Compliance (Y2K) Code

Posted on 1998-06-10
7
159 Views
Last Modified: 2010-05-03
Does anyone have any code that will test for the standard y2k bugs??? I would like to taylor the code to send results to a txt file or database (preferred) any help would be appreciated. It seems all the products I've seen do not have this functionality.  So I would like to write my own.. a step in the right direction is all I need.. thanks!

GW
0
Comment
Question by:gcw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:zsi
ID: 1463041
As long as you use the Date datatype, VB and Access (Jet) are Y2K compliant.
0
 

Author Comment

by:gcw
ID: 1463042
I know VB is y2k compliant.. I need some code that will test the "machine" for compliance.  thanks
0
 
LVL 4

Expert Comment

by:zsi
ID: 1463043
What?  Like the OS or the BIOS?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gcw
ID: 1463044
BIOS CMOS Clock Settings... etc...
0
 
LVL 2

Accepted Solution

by:
khaled022498 earned 150 total points
ID: 1463045
The following code evaluates the data entered into a textbox named txtDate
when you click cmdConvertDate. If the date contains a two-digit year, the
date is converted into a four-digit year date according to the sample rule.
The code then displays the initial date entered, the full year as converted
by the code according to the sample rule, and the full year is converted by
the defaults native to Visual Basic. Finally, the date displayed in txtDate
is converted to a non-ambiguous date with the appropriate four-digit year

Private Sub cmdConvertDate_Click()
       Dim strYear As String
       Dim intSlash As Integer
 
       If IsDate(txtDate) or txtDate = "2/29/00" Then
           'Find first date separator.
           intSlash = InStr(txtDate, "/")
           If intSlash > 0 Then
               'Find second date separator.
               intSlash = InStr(intSlash + 1, txtDate, "/")
               If intSlash > 0 Then
                   'Extract the year from the date.
                   strYear = Mid(txtDate, intSlash + 1)
                   If Len(strYear) = 2 Then
                       If CInt(strYear) < 50 Then
                       ' Less than 50: year = 20XX.
                           strYear = "20" & strYear
                       Else
                       ' Greater than 50: year = 19XX.
                           strYear = "19" & strYear
                       End If
                   End If
                   MsgBox "Date Entered: " & txtDate
                   MsgBox "Year (Our Rule): " & strYear
                   MsgBox "Year (VB Default): " & Year(txtDate)
               Else
                   MsgBox "Date not in expected format!"
               End If
           Else
               MsgBox "Date not in expected format!"
           End If
       Else
           MsgBox "Not a valid date!"
       End If
       '  Clarify date in txtDate.
       txtDate.Text = Left(txtDate.Text, intSlash) & strYear
   End Sub
 
also this link might help you

http://www.microsoft.com/Ithome/topics/year2k/default.htm


0
 
LVL 4

Expert Comment

by:zsi
ID: 1463046
I have yet to come across a PC that did not support a four-digit year.  Have you found otherwise?
0
 

Author Comment

by:gcw
ID: 1463047
Thanks for the Info! and the link.. I checked it out... now I don't have to write anything! Your comments were greatly appreciated

No I haven't, but If there are some among our 400+ systems, I would like to find them now before there is a problem.

Thanks for the comment!
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

617 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