![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif)
Microsoft Year 2000 Readiness Disclosure & Resource Center |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) | Visual Basic (16-bit) 4.0 (French) - 16-Bit Win
Product Summary |
Product: Visual Basic (16-bit) Version: 4.0 |
Category: Not Compliant* Operating System: 16-Bit Win |
Language: French |
Release Date: 01 Jan 1995 |
Operational Range: |
- |
Can applications be built with this tool that adhere to the Microsoft Year 2000 Compliance Statement? Yes |
Prerequisites: |
See Below |
Product Dependencies: |
MS-DOS, Windows 3.x, Windows NT 4 Service Pack 4 + software updates, Windows NT 3.51 Service Pack 5 + software updates, Windows 95, Windows 98 with software updates |
Clock Dependencies: |
System Clock, Visual Basic runtime, (OLE) Automation Libraries |
Last Updated: |
28 Sep 1999 | |
Product Details |
This report applies to:
VB 4.0 (16-bit)- Standard, Professional, Enterprise, Working Model
Developing Year 2000 Compliant Software
Operational Range for Data: 1/1/2000 using defaults for 2-digit year
How the product runtime handles dates:
Visual Basic 4.0 (16-bit) converts 2-digit years to the century of the current system date. Depending on the function used, Visual Basic converts the date based on defaults in either the 16-bit Automation libraries or the runtime library. The defaults in the 16-bit Automation libraries have not been modified since Visual Basic 4.0 released. Therefore the behavior is consistent regardless of which date function is used.
Two-digit shortcut handling:
During the Visual Basic 4.0 development cycle, a new rule for two-digit date-handling was developed. A 2-digit year would be converted to the current century of the system date. Thus, Year(Date("1/1/00")) would evaluate to the current century. This new rule was implemented in the OLE Automation libraries used by Visual Basic 4.0 and Visual Basic for Applications. The Visual Basic 4.0 runtime library also implements the rule for the DateSerial function.
Visual Basic 4.0 was developed with this interoperability in mind and began to rely on the OLE Automation libraries to convert 2-digit years to 4-digit years in most cases. The exception to the rule is the DateSerial function that was implemented in the Visual Basic runtime library because Visual Basic required more functionality than the OLE Automation library could provide at that time.
Recommended practices to develop year 2000 compliant applications with this Development Tool:
Users can use their own set of rules instead of relying on the defaults native to Visual Basic. For example, users may enter only a 2-digit year and have 00 to 49 correspond to the years 2000 to 2049 and have 50 to 99 correspond to the years 1950 to 1999.
When accepting a date string from the user, test the format of the string to determine the number of digits entered for the year. According to the rules for this sample application, 1/11/45 is in the year 2045, and not in the year 1945. Within the code for the application, change the string to use the appropriate 4-digit year, and then convert that date string with the 4-digit year into a date variable.
Please refer to the white paper, "Developing Y2K Compliant Applications with Visual Basic"
Common development errors dealing with year 2000 date issues:
Please refer to the white paper, "Developing Y2K Compliant Applications with Visual Basic"
Other design time issues to be aware of when using this tool:
Visual Basic 4 16bit has a system date dependant issue in its code editor. Date literals (e.g. d = #10/7/97#) in the 1900s are truncated to 2-digit years. If a VB4-16 project is loaded on a machine that has the system clock set to a date greater than or equal to (>=) the year 2000, this date is re-parsed as belonging to the 2000Æs (e.g. d = #10/7/2097#). Additionally, with the system clock set greater than or equal to (>=) the year 2000, no date from the 1900Æs can effectively be represented as a date literal.
NOTE: This specification applies ONLY TO THE DESIGN ENVIRONMENT. Visual Basic 4.0-16 bit compiled applications are not affected, only the text-based source code is. This is a very important distinction that must be understood to understand the relevance of this issue to developers (i.e. it is only of interest to those people developing or maintaining the code for VB4-16 bit applications, not for end-users who are using VB4-16bit developed applications). Other versions of the Visual Basic programming language are not subject to this behavior.
Example #1: Editing existing code after the system clock as passed 1/1/2000
System date: 10/7/98, user enters the code:
Function CalculatePorfolioPerformaceSinceStart
æUser entered #10/7/1998#, was parsed by VB to 2 digits
Const PORFOLIO_START_DATE = #10/7/98#
End Function
The year 2000 has now come and the developer is asked to update the code or add a feature. The developer loads the code in Visual Basic 4.0 16-bit and makes the change/addition.
The problem: This date has been re-parsed and automatically been changed to:
Function CalculatePorfolioPerformaceSinceStart
Const PORFOLIO_START_DATE = #10/7/2098#
End Function
Example #2: Entering a 19xx date after the system clock has passed 1/1/2000
The year is 2000. A VB4-16 developer attempts to enter a date from the 1900s:
æUser entered #10/7/1998# The year is parsed into 1998.
Const PORFOLIO_START_DATE = #10/7/98#
The developer saves his project.
Then re-loads his project.
The issue: The date has been changed to:
Const PORFOLIO_START_DATE = #10/7/2098#
Microsoft has provided an update for the VB4-16 code editor
This update will provide two operations:
- When a date constant is entered into the code window by the developer, it will be displayed and saved as a four-digit year, e.g Const SOME_DATE = #10/7/1998#.
- When existing code is loaded that has 2-digit date constants, they will be interpreted and displayed as 4-digit years in 19xx. When the code is re-saved, it will be saved using 4-digit years, e.g. Const SOME_DATE = #10/7/98# becomes SOME_DATE = #10/7/1998#
Thus, with this update, the VB4-16 bit editor will be able to handle date literals as developer code after the year 2000. This update is contained in an updated VBA2.DLL that will be released in April 1999. Again, this issue does not affect end users or their Visual Basic 4-16bit applications, only the Visual Basic 4 development environment.
Please visit http://msdn.microsoft.com/vbasic/downloads/vb4-y2k.asp for more information and to download the update.
Testing guidelines and recommendations:
The following code evaluates the data entered into a textbox named txtDate when the user clicks cmdConvertDate. If the date contains a 2-digit year, the date is converted into a 4-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 converted by the defaults native to Visual Basic.
Finally, the date displayed in txtDate is converted to a non-ambiguous date with the appropriate 4-digit year.
This code requires that dates are entered in the mm/dd/yy format, but it could easily be changed to handle a different date format:
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
| |
Return to Search Screen
Legend of Symbols: |
* |
The product is compliant with recommended customer action. This indicates a prerequisite action is recommended which may include loading a software update or reading a document. |
# |
The product is compliant with acceptable deviations from Microsoft's standard of compliance. An acceptable deviation does not affect the core functionality, data integrity, stability, or reliability of the product. |
+ |
The product is compliant with pending Year 2000 software updates. Future maintenance actions will be recommended shortly. See Product Guide for further details. |
Note: Compliance ratings given for each product assume that all recommended actions have been taken. |
If after reviewing this information you have additional questions related to this product, click here.
YEAR 2000 READINESS DISCLOSURE
ALL COMMUNICATIONS OR CONVEYANCES OF INFORMATION TO YOU CONCERNING MICROSOFT AND THE YEAR 2000, INCLUDING BUT NOT LIMITED TO THIS DOCUMENT OR ANY OTHER PAST, PRESENT OR FUTURE INFORMATION REGARDING YEAR 2000 TESTING, ASSESSMENTS, READINESS, TIME TABLES, OBJECTIVES, OR OTHER (COLLECTIVELY THE "MICROSOFT YEAR 2000 STATEMENT"), ARE PROVIDED AS A "YEAR 2000 READINESS DISCLOSURE" (AS DEFINED BY THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT) AND CAN BE FOUND AT MICROSOFT'S YEAR 2000 WEBSITE LOCATED AT http://www.microsoft.com/year2000/ (the "Y2K WEBSITE"). EACH MICROSOFT YEAR 2000 STATEMENT IS PROVIDED PURSUANT TO THE TERMS HEREOF, THE TERMS OF THE Y2K WEBSITE, AND THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT FOR THE SOLE PURPOSE OF ASSISTING THE PLANNING FOR THE TRANSITION TO THE YEAR 2000. EACH MICROSOFT YEAR 2000 STATEMENT CONTAINS INFORMATION CURRENTLY AVAILABLE AND IS UPDATED REGULARLY AND SUBJECT TO CHANGE. MICROSOFT THEREFORE RECOMMENDS THAT YOU CHECK THE Y2K WEBSITE REGULARLY FOR ANY CHANGES TO ANY MICROSOFT YEAR 2000 STATEMENT. EACH MICROSOFT YEAR 2000 STATEMENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. CONSEQUENTLY, MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. MOREOVER, MICROSOFT DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY MICROSOFT YEAR 2000 STATEMENT IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY MICROSOFT OR ITS AUTHORIZED REPRESENTATIVES SHALL CREATE A WARRANTY OR IN ANY WAY DECREASE THE SCOPE OF THIS WARRANTY DISCLAIMER. IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER REGARDING ANY MICROSOFT YEAR 2000 STATEMENT INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS, PUNITIVE OR SPECIAL DAMAGES, EVEN IF MICROSOFT OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, SO THE FOREGOING LIMITATION MAY NOT APPLY TO YOU. THE INFORMATION CONTAINED IN EACH MICROSOFT YEAR 2000 STATEMENT IS FOUND AT THE Y2K WEBSITE AND IS INTENDED TO BE READ IN CONJUNCTION WITH OTHER INFORMATION LOCATED AT THE Y2K WEBSITE, INCLUDING BUT NOT LIMITED TO MICROSOFT'S YEAR 2000 COMPLIANCE STATEMENT, THE DESCRIPTION OF THE CATEGORIES OF COMPLIANCE INTO WHICH MICROSOFT HAS CLASSIFIED ITS PRODUCTS IN ITS YEAR 2000 PRODUCT GUIDE, AND THE MICROSOFT YEAR 2000 TEST CRITERIA.
ANY MICROSOFT YEAR 2000 STATEMENTS MADE TO YOU IN THE COURSE OF PROVIDING YEAR 2000 RELATED UPDATES, YEAR 2000 DIAGNOSTIC TOOLS, OR REMEDIATION SERVICES (IF ANY) ARE SUBJECT TO THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT (112 STAT. 2386). IN CASE OF A DISPUTE, THIS ACT MAY REDUCE YOUR LEGAL RIGHTS REGARDING THE USE OF ANY SUCH STATEMENTS, UNLESS OTHERWISE SPECIFIED BY YOUR CONTRACT OR TARIFF.
|