Solved

2000 Compliance (Y2K) Code

Posted on 1998-06-10
7
151 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 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

15 Experts available now in Live!

Get 1:1 Help Now