Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

2000 Compliance (Y2K) Code

Posted on 1998-06-10
7
Medium Priority
?
160 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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

704 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