Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

2000 Compliance (Y2K) Code

Posted on 1998-06-10
7
Medium Priority
?
162 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
Industry Leaders: 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 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

773 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