Quick Search for:  in language:    
program,test,Visual,Basic,currently,running,w
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


B++ Builder - VB without runtimes
By Anthonius on 6/30


Mr Blonde - Chat Program
By Mr Blonde on 6/30


MSN Messenger Status Detector
By Ryan Cain on 6/30


MSN advanced
By alias1990 on 6/30


MSN Messenger advanced
By alias1990 on 6/30


Locate Database
By Erica Ziegler-Roberts on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Y2K Test for VB5 and 6

Print
Email
 

Submitted on: 5/14/1999
By: Preston Smith  
Level: Not Given
User Rating: By 102 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 6333 times.
 
 
     This program test the Visual Basic program you are currently running. As you will see.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Y2K Test for VB5 and 6
' Description:This program test the Visu
'     al Basic program you are currently runni
'     ng. As you will see.
' By: Preston Smith
'
' Assumes:You can adjust the dates for J
'     an 1st 1930, Jan 1st 2029, Jan 1st 00 an
'     d Feb 29 or 30 2000. To see if your vers
'     ion is compliant then you should use 1/1
'     /00 for the year 2000, and 2/29/00 for t
'     he Leap Year date (this will cause a run
'     -time error, if NOT compliant). I made a
'     big mistake before, the date regarding t
'     he leap year, should not cause a run tim
'     e error if it is compliant.
'
' Side Effects:If you set up the code to
'     check for the leap year date you should 
'     have a run-time error. If you do NOT hav
'     e an error that is good. If you actually
'     see a date then your version of VB is no
'     t compliant with Y2K. The updates and pa
'     tches may be available at microsoft's MS
'     DN websight. Problems? Get the SP3 updat
'     es, Go here (VB6): http://msdn.microsoft
'     .com/vstudio/sp/default.asp Go here (VB5
'     ): http://msdn.microsoft.com/vstudio/sp/
'     vs97/default.asp
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1776&lngWId;=1'for details.'**************************************

Sub Form_Load()

Dim MyDate as Date MyDate = "1/1/00" 'Or 'MyDate = "1/1/29" 'Returns 1/1/2029 'MyDate = "1/1/30" 'Returns 1/1/1930 'MyDate = "2/29/00" 'The Leap Year Date ' (Usually causes the most probs) MsgBox Format(MyDate, "mm/dd/yyyy") End Sub


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/14/1999 12:05:00 PM:Craig
Is the runtime error because there 
never is a Feb. 30th? Should be Feb. 
29th on a leap year?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/19/1999 10:31:00 PM:ARRiVE
Yes That is the compiler catching it at 
runtime depending on prefs. Or it is a 
type mismatch on run time. the 29th is 
a leap a year! no wonder we have so 
many Y 2 K issues =\
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/20/1999 12:33:00 PM:Preston Smith
Ooops.  The date should be 2/29/00 to 
test for the leap year.  I will fix 
that.  The error is a Type Mismatch 
regardless of the date.  Either way, if 
there is know error, then there is 
something wrong with VB.  Otherwise, if 
you get the Mismatch error, then there 
is nothing wrong with the code.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/9/1999 7:18:00 PM:Jargalsaikhan.B
Thanks for your free source!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/9/1999 9:33:00 PM:Jean
Good job Preston looks like you'll be 
helping me next year!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/10/1999 8:30:00 AM:ed
The year 2000 is a leap year so there 
should be no error when running the 
last test
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/11/1999 12:19:00 AM:Rob
Well i have VS6.0 SP3 and i get no 
error, am i missing something 
here?
hehe thanx
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/20/1999 3:59:00 PM:Bill
I have the same problem as Rob, but i'm 
using VB 5.0
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/20/1999 4:09:00 PM:Drunk_Cowboy
Im running VB5 what can you do to fix 
your VB if you don't get an error ?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/25/1999 3:05:00 AM:DSN
Basic, but Good
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/6/1999 5:39:00 PM:Bill
To fix VB you would have to get into 
the source code of VB and fix it. That 
means you can't fix it.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/6/1999 9:50:00 PM:Preston
From what I read at MSDN online, the 
Y2K problem can be repaired by 
installing the SP3 Updates.  Of course, 
this is Microsoft were talking about.  
I had an error with VB6.0.  I don't 
have the mismatch error anymore after 
installing the patch.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/9/1999 7:42:00 PM:Beth Develos
Thanks for the code...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/1/1999 6:57:00 PM:Dan
We Have an old (not updated) version of 
VB5 but we updated Win 98 with Y2K 
Fix
No problem with any of your code 
including my own little 
addition:
MsgBox Format(MyDate + 1, 
"mm/dd/yyyy")
on the leap year that 
shows the correct 03/01/2000 date.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.