How to upgrade a Visual Basic 6.0 project group to Visual Basic .NET or Visual Basic 2005 (309617)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
This article was previously published under Q309617 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.
back to the top
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:
- Client componentBusiness componentData access
component
- Business componentData access component
- 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:
- Upgrade the middle tier.Change the Visual Basic 6.0
client to access the middle tier.Run the middle tier.
- Change the Visual Basic 6.0 client to access the middle
tier.Run the middle tier.
- 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.
back to the top
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.
- 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. - 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.
- Follow the steps in the wizard to create a new Visual Basic
.NET or Visual Basic 2005 client project and an upgrade report.
- 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.
- 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.
- 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.
- Review the upgrade report, and modify the new Visual Basic
.NET or Visual Basic 2005 business component as recommended.
- 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.
- 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.
- 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.
- Review the upgrade report, and modify the new Visual Basic
.NET or Visual Basic 2005 data access component as recommended.
- 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.
- Test the application to ensure that it works
properly.
back to the top
REFERENCES For more information, refer to the following Microsoft Web
sites:
back to the top
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbMigration kbHOWTOmaster KB309617 kbAudDeveloper |
---|
|