Solved

Upgrade from VB3 to VB5.

Posted on 1998-05-05
7
443 Views
Last Modified: 2012-06-27
I am upgrading a medium sized application from VB3 to VB5.  Are there any known issues/problems that I should look out for?  In particular I am using a lot of data access code (createsnapshot etc) on an Access database and and external Oracle database.
0
Comment
Question by:jonesrw
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1440479
Your data access code should port over fairly ok.  VB5 is backward compatible.

The biggest issue I've seen (and dealt with) is having ocx versions of the vbx's.
0
 
LVL 4

Accepted Solution

by:
zsi earned 100 total points
ID: 1440480
There are several issues that you will have to look out for in porting your VB3 code to VB5.  The biggest issue that you will have to deal with is that VB5 does not use VBXs.  You will have to upgrade ALL of your controls to OCX/ActiveX controls.  

Next, as VB5 is only available for developing 32bit applications, any API calls that you make must be converted to support the 32bit environments.  Specifically, this will apply to the Windows API where all resource handles are now of type Long, as opposed to type Integer.

Data access (JET) works a little differently in VB5.  The changes aren't major, but the will require some modifications.  The most significant of these changes are with snapshots, dynasets, and the like.  They are now collectively referred to as recordsets.  Their behaviors is determined by a parameter in the OpenDatabase function.  The help file for VB5 should detail conversion issues for database access.

Your ODBC drivers will need to be replaced with 32bit drivers, and any functions calls will have to be updated as necessary.

Some commands and functions in VB3 have been replaced with new ones in VB5.  While VB5 still supports these deprecated commands, Microsoft does not guarantee support for them in future versions.

Hope this helps!

zsi
0
 
LVL 4

Expert Comment

by:zsi
ID: 1440481
Further Reading:

Microsoft Press' book "Advanced Visual Basic 5" has an entire chapter devoted to converting existing versions of VB.  It details the pros and cons, the whats and whys.  If you have the current version of the MSDN, the full book is on the Library disc.  

Thise excerpt from the book might also prove useful.  For formatting purposes, I have included it as HTML.

zsi
==============================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
<title>Summary of Changes from a Previous Version of Visual Basic to Visual Basic 5</title>
<style>@import url(stylesheets/msdn_ie4.css);</style>
<link disabled rel="stylesheet" href="stylesheets/msdn_ie3.css"></HEAD>
<BODY BGCOLOR=#FFFFFF TEXT=#000000>
<FONT FACE="Verdana,Arial,Helvetica" SIZE="2"><form name=x><object name=iv classid="clsid:9c2ac687-ceef-11cf-96d9-00a0c903b016">
</object></form>
<h1><a name="summaryofchangesfrompreviousversionofvisualbasictovisualbasic5"></a>Summary of Changes from a Previous Version of Visual Basic to Visual Basic 5</h1>
<p>
The following table shows the changes you need to consider when you convert from a previous version of Visual Basic to Visual Basic 5.</p>
<table border=1 cellpadding=5 cols=4 frame=below rules=rows>
<tr valign=top>
<td class=blue width=148><b>Possible Pitfall</b></td>
<td class=blue width=148><b>Visual Basic 3 </b></td>
<td class=blue width=148><b>16-Bit Visual Basic 4</b></td>
<td class=blue width=148><b>32-Bit Visual Basic 4</b></td>
</tr>
<tr valign=top>
<td width=148>DAO</td>
<td width=148>Changed</td>
<td width=148>Changed</td>
<td width=148>Changed</td>
</tr>
<tr valign=top>
<td width=148>Windows 3.<i>x</i> APIs no longer available</td>
<td width=148>Unchanged</td>
<td width=148>Unchanged</td>
<td width=148>Changed</td>
</tr>
<tr valign=top>
<td width=148>Shell changes</td>
<td width=148>If moving from Windows 3.<i>x</i> to Windows 95 or Windows NT 4</td>
<td width=148>If moving from Windows 3.<i>x</i> Windows 95 or Windows NT 4</td>
<td width=148>If moving from Windows 3.<i>x</i> to Windows 95 or Windows NT 4</td>
</tr>
<tr valign=top>
<td width=148>New ODBC API library</td>
<td width=148>Changed</td>
<td width=148>Changed</td>
<td width=148>Unchanged</td>
</tr>
</table><br>
<h1></h1>
</BODY>
</HTML>



0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 4

Expert Comment

by:zsi
ID: 1440482
The book also makes reference to a VB3 to VB5 migration utility.  As I only have an electronic version of the book, I do not not if this is included or if it is a separate utility.  However, It is supposed to automatically convert API declarations and generate reports on  other VB3-related issues.

zsi
0
 

Author Comment

by:jonesrw
ID: 1440483
Thanks for you helpful answer......how do I read the html script???
0
 

Author Comment

by:jonesrw
ID: 1440484
Thanks for your helpful answer......how do I read the html script???
0
 
LVL 4

Expert Comment

by:zsi
ID: 1440485
Copy the HTML script into Notepad and save the file to a temporary directory.  Name it something like "Conversion.htm".  Then, load the page in to your browser of choice.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question