How to upgrade a Visual Basic 6.0 project group to Visual Basic .NET or Visual Basic 2005

Article translations Article translations
Article ID: 309617 - View products that this article applies to.
This article was previously published under Q309617
Expand all | Collapse all

On This Page

SUMMARY

This article describes how to upgrade a Visual Basic 6.0 project group or an n-tier application to Visual Basic .NET or Visual Basic 2005.

Description of the Technique

If you upgrade a Visual Basic 6.0 project group or an n-tier application to Visual Basic .NET or Visual Basic 2005, you must upgrade one project or tier at a time.

If your three-tier application includes a client component, a business component, and a data access component, you should upgrade the application in the following order:
  1. Client componentBusiness componentData access component
  2. Business componentData access component
  3. Data access component
In an n-tier application, always upgrade the client tier first, and then upgrade other tiers on the dependency tree. You should follow this order for two reasons:
  • This approach allows you to keep the application working. When you upgrade the client, you break and work with only one component of the application. All of the other components continue to work the same way that they did previously. With this approach, you isolate the work area. Alternately, if you upgrade the data tier first, suddenly you break the data tier and the components that depend on the data tier.
  • Visual Basic 6.0 locks type libraries (TypeLibs). This creates a problem if you need to rebuild the TypeLib or recompile the underlying dynamic-link library (DLL). If you upgrade the business tier first and then upgrade the client, you must continually stop and restart Visual Basic 6.0 every time you change the middle tier. Consider the following workflow:

    1. Upgrade the middle tier.Change the Visual Basic 6.0 client to access the middle tier.Run the middle tier.
    2. Change the Visual Basic 6.0 client to access the middle tier.Run the middle tier.
    3. Run the middle tier.

    If you want to change the .NET DLL, you must then close Visual Basic 6.0, recompile in Visual Basic .NET or in Visual Basic 2005, restart Visual Basic 6.0, and so on. You can avoid this problem if you upgrade the client first and then upgrade the middle tier.
To upgrade each Visual Basic 6.0 application, use the Upgrade tool that is included with Visual Basic .NET or Visual Basic 2005. The Upgrade tool is started when you use Visual Basic .NET or Visual Basic 2005 to open a Visual Basic 6.0 project. When you use the Upgrade tool, the Visual Basic 6.0 project is not changed, and a new Visual Basic .NET or Visual Basic 2005 project is created. Before you upgrade a Visual Basic 6.0 project, it is best to prepare it for upgrade. For more information, refer to the REFERENCES section.

Upgrade an N-Tier Visual Basic 6.0 Application to Visual Basic .NET or Visual Basic 2005

This section provides in-depth information about how to upgrade a three-tier Visual Basic 6.0 application (which consists of a client component, a business component, and a data access component) to Visual Basic .NET or Visual Basic 2005.
  1. Compile each of the projects in Visual Basic 6.0, and test the projects to ensure that the application works properly.

    NOTE: It is important to build the group because the new Visual Basic .NET or Visual Basic 2005 client project still uses the business and data component from Visual Basic 6.0 through Interop. Similarly, the new Visual Basic .NET or Visual Basic 2005 business component project still references the data component from Visual Basic 6.0 through Interop.
  2. Upgrade the client component first. Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005, and open the Visual Basic 6.0 client project. The Upgrade Wizard is started.

    NOTE: The Visual Basic .NET or Visual Basic 2005 Upgrade Wizard is included in Visual Studio .NET Professional or in Visual Studio 2005.

  3. Follow the steps in the wizard to create a new Visual Basic .NET or Visual Basic 2005 client project and an upgrade report.
  4. Review the upgrade report, which typically includes warnings about additional modifications that are required. Modify the new Visual Basic .NET or Visual Basic 2005 client project as recommended.
  5. Run the new Visual Basic .NET or Visual Basic 2005 client project to verify that the client works. Remember that the new client still references the Visual Basic 6.0 business and data access component through Interop.
  6. Upgrade the middle tier (the business object). Open the Visual Basic 6.0 business object project in Visual Basic .NET or Visual Basic 2005, and complete the steps in the Upgrade Wizard.
  7. Review the upgrade report, and modify the new Visual Basic .NET or Visual Basic 2005 business component as recommended.
  8. Because the new Visual Basic .NET or Visual Basic 2005 client project still references the Visual Basic 6.0 business component, delete this reference, and add a new reference to the newly created Visual Basic .NET or Visual Basic 2005 business component project.
  9. Test the application to ensure that it works properly. Remember that the client and business components are still using the Visual Basic 6.0 data access component.
  10. Upgrade the final tier (the data access component). Open the Visual Basic 6.0 data access component project in Visual Basic .NET or in Visual Basic 2005, and complete the steps in the Upgrade Wizard.
  11. Review the upgrade report, and modify the new Visual Basic .NET or Visual Basic 2005 data access component as recommended.
  12. Delete any references to the Visual Basic 6.0 data access component in the Visual Basic .NET or Visual Basic 2005 business and client components, add references to the new Visual Basic .NET data access component project.
  13. Test the application to ensure that it works properly.

REFERENCES

For more information, refer to the following Microsoft Web site:
Preparing Your Visual Basic 6.0 Applications for the Upgrade to Visual Basic.NET
http://msdn.microsoft.com/en-us/library/aa260644.aspx

Properties

Article ID: 309617 - Last Review: December 6, 2006 - Revision: 2.5
APPLIES TO
  • Microsoft Visual Basic 2005
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
Keywords: 
kbvs2005swept kbvs2005applies kbmigration kbhowtomaster KB309617

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com