Solved

2000 Compliance (Y2K) Code

Posted on 1998-06-10
7
152 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
  • 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
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.

 

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

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

867 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