Go Back   Access World Forums > Apps and Windows > VB.NET

Thread Tools Rate Thread Display Modes
Old 06-07-2017, 01:59 AM   #1
Newly Registered User
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Help going from VB 5 to VB.Net

I'm thinking of getting VB. Net and would like some advice please.

I have a project written in Visual Basic version 5.
Will VB.net be able to do the same things as VB5?

what is the best way to convert a project written in VB version 5 to vb.net?
I also have VB version 6 but have never used it.

Can VB.Net be obtained free and legal? Where is the best place to get it from?

thank you in advance


smiler44 is offline   Reply With Quote
Old 06-13-2017, 07:51 AM   #2
Newly Registered User
Join Date: Nov 2015
Posts: 823
Thanks: 4
Thanked 194 Times in 180 Posts
static will become famous soon enough static will become famous soon enough
Re: Help going from VB 5 to VB.Net

Visual studio express is free for none commercial use.

vb.net will do anything that previous versions did.

Copy your old code in. It will give you a list of errors to fix.
The biggest difference I found when converting a VB6 project was dates which are no longer numeric.
static is offline   Reply With Quote
The Following User Says Thank You to static For This Useful Post:
smiler44 (09-11-2017)
Old 06-13-2017, 02:39 PM   #3
Super Moderator
Join Date: Jan 2009
Location: NSW Australia
Posts: 11,710
Thanks: 105
Thanked 1,511 Times in 1,424 Posts
Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold
Re: Help going from VB 5 to VB.Net


Galaxiom is offline   Reply With Quote
Old 01-29-2019, 03:27 AM   #4
Newly Registered User
Join Date: Jan 2019
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
vedika is on a distinguished road
Re: Help going from VB 5 to VB.Net

These are steps to migrate to VB.Net

Decide whether to upgrade or not. There are program types that are best left in your current VB version. Projects that use UserControls, WebClasses, DHTML pages, VB's add-in model and other special techniques cannot easily be upgraded. Use a compatibility check tool to estimate what you can upgrade to VB.NET and how much work it will require. Alternatively, try to load your project in VB.NET and see the upgrade report for critical issues.

Remove dead and duplicated code. Start by deleting all the code your programs don't use. It is not uncommon to have 30-40% dead code in a medium or large sized project. Migrating that code means extra burden and no benefits. Additionally, you should consider joining any duplicated functions to reduce the amount of code even further. Now, how do you know what code is dead or duplicated? Of course you can try to find that out manually, but if your goal is to minimize work, we strongly recommend that you get a decent source code analyzer to find the dead and duplicated code.

Upgrade problematic syntax and controls. Use of certain syntax and control versions will cause you a lot of trouble. Take the Data control or VB5 Common Controls controls (ComCtl32.ocx or ComCt232.ocx), for example. You must upgrade to ADO data control or MsComCtl.ocx and MsComCt2.ocx, respectively. And, if you happen to be still in VB3 or VB4, you must port it to VB6 first. Obsolete syntax like GoSubs need to get removed, and you even need to prepare your conditional compilation (#If statements). Fortunately, you don't have to upgrade everything, only those things that the VB.NET upgrade wizard doesn't handle. Use a compatibility check tool that recommends what to fix now and what to leave as is.

Fix your data declarations. If you've used a lot of Variants and undeclared variables, you're almost doomed. Now it's your final chance to add those Option Explicit statements and add proper type declarations to every Dim statement. Not only will this make your code more robust and optimized - it will also enable the upgrade wizard to properly port your code. Control object variable declarations are of special importance if you don't feel like writing half of your method and property calls again. In addition, certain array and user-defined structure definitions are going to change. Use a source code analyzer that lists the declarations requiring a fix.

Load your code in VB.NET. Let the upgrade wizard do its job. You'll get a large report detailing the found upgrade issues, both fixed and unfixed. You'll get comments in the code near places that need to get worked on. What you're not getting is a list of undetected issues, of course.

Try to compile your project. It won't succeed. You'll have a long list of compile errors. Now it really starts to pay off to be properly prepared. The list would be much longer if you hadn't prepared in advance.

Go back. You might want to go back to step 1, 2, 3 or 4, fix some issues, and then go to step 5 and run the upgrade wizard again.

Compile & fix cycle. Fix all the compiler issues. Finally, it runs.

Fix the commented issues. The upgrade wizard left comments in your code. Find them and do what they say. Now it's also beneficial to review a list of expected behavior changes, like events that won't fire.

Test. Now you're back to daily life. Run and test your program to make sure it works as expected.

vedika is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

All times are GMT -8. The time now is 11:25 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World