?
Solved

VB 6 vs Windows XP compatibility

Posted on 2003-03-18
29
Medium Priority
?
291 Views
Last Modified: 2007-12-19
I have a situation:

A VB 6 application written for Windows 95.  The application is in executable file format.  The application is a front-end links to an MS Access 97 database.
I install the executable application on Windows XP.  But how come some of the function works on Windows 95 but does not work on Windows XP, such as update fucntion, add function, and importing a spreadsheet.  I got run-time errors.  Does anyone know the reason?

Thanks
0
Comment
Question by:babytam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 16
  • 11
  • 2
29 Comments
 
LVL 1

Expert Comment

by:Piter
ID: 8165384
hi,
You have to run service pack 2 or serice pack 3 on windown XP machine.

you will get it on www.microsoft.com.
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8165557
Also worth while checking if all the dll's the app uses on win 95 are present on your win xp system.

Try starting with checking for differences in file versions as well to see if there are any obvious problems.  

http://support.microsoft.com/default.aspx?scid=/servicedesks/fileversion/dllinfo.asp&SD=MSDN&FR=0


By the way, some DLLs which are not part of win 95 OS, are now standard on later OS.  e.g. Urlmon.dll and wininet.dll

Also Win 95 does not have file protection therefore your installer will freely install all the dlls regardless of any potential problems.  XP has windows file protection for Dlls installed as part of OS. This may be worth looking at.

222193 Description of the Windows File Protection Feature (Windows 2000 and XP)
http://support.microsoft.com/?id=222193


0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8165563
You may also need to install MDAC_typ.exe 2.5 if you want jet drivers for 97.

Win 95 tends to need DCOM95, you don't need to install this with Win XP.

Raf

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:babytam
ID: 8171204
Piter,
You meant the Win XP service pack 2 or 3?  Why would that help?

rafsalman,
I will check it.....however,
the setup file of the program installs all the dependencies on the XP machine.  All the .dll and .ocx files that the program needed to run.  I do get messages, during the installation, saying that the file it's going to install already exist on the computer, but the one on the computer is a later version and it asks me if I want to replace the file.  I said no. Also, sometimes when the .dll file already exist, it won't let me replace it so I ignore the message.  Could this cause the problems too?

The run-time errors that I got are such as:
"Run-time error -2147467259 (80004005): Insufficient base table information for updating or refreshing."

"Run-time error -2147317888 (80040e20):  Method '~' or object '~' failed"

"Run-time error -2147217887 (80040e21):  Multiple-step operation generated errors.  Check each status value."

These errors messages occurs when I try to add or update records, or importing an excel spreadsheets.  Again, I did not get these errors in Win 95.
0
 
LVL 1

Author Comment

by:babytam
ID: 8171884
Piter & Raf,

If I want to install MDAC 2.5 Service pack, which one should I use?  SP2 or SP3?

Thanks,
Tam
0
 
LVL 1

Expert Comment

by:Piter
ID: 8172390
Try to service pack 2 first. and note down dll's which it wants to upgrade. In service Pack 2 it will install new dll's so while running setup check the dates of Dll's . and install currently dated dll's.
Run time errors will come if you open any database connection and dosent closed while closing your program.
Check in all forms all connection close.
and recordset = nothing.
if possible write complete error message.
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8172575
I would use SP3.

I can't see any advantage using SP2 to deploy with your application.
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8172636
By the way, in the installation:


>Also, sometimes when the .dll file already exist, it >won't let me replace it so I ignore the message.  Could >this cause the problems too?

This is normal.  ME, 2k and XP all have Windows File Protection and so will not allow you to install different OS DLLs than those present on your system.  You can enter the DLLs you install with your app onto the MS website i gave earlier and see if they are part of the OS standard
installation.  If you try and install one of these DLLs it will fail to be registered and may cause installer to restart repeatedly.

If a DLL fails to install this could be an issue - check to see if the DLL is registered on the system and compare version numbers as a point to start to figure out why it goes wrong. You could try manually trying to register it using regsvr32 and try and identify the problem.

You could also check the installer log file to see if there were any issues on installing.

>do get messages, during the installation, saying that the >file it's going to install already exist on the computer, >but the one on the computer is a later version and it >asks me if I want to replace the file.  I said no.

In your installer I recommend always using the oldest DLL versions possible for your target system.  In some cases a Win 2k DLL or XP DLL is older than it's ME counterpart. If the user has a newer version then great - let them keep it.
If it's not present then it will be installed.  This applies to MS DLLs.


>"Run-time error -2147467259 (80004005): Insufficient base >table information for updating or refreshing."

Not sure on this one.  Would need to identify where it happens in your code and work from there. You need to add error handling or at least use a series of msgbox to identify where it happens if it does not occur in the IDE.

>"Run-time error -2147317888 (80040e20):  Method '~' or >object '~' failed"

This could be a DLL issue - ie no Jet drivers present.

If you app works fine on 95 this is probably the case. Otherwise you may have left connections/recordsets open when they needed to be closed (e.g. recordset open going into a transaction, trying to access database without opening connection correctly first)

>"Run-time error -2147217887 (80040e21):  Multiple-step >operation generated errors.  Check each status value."

Can't say from this.



Hope this helps


Raf
0
 
LVL 1

Author Comment

by:babytam
ID: 8179427
Raf,
DMAC 2.5 SP3 already installed by default on Win XP.  So I tried to install the DMAC 2.7 SP3 but that didn't solve the problem either.  Perhaps installing the Visual Studio SP4 or something like that would help?

Thanks,
Tam
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8179743
The 2.7 MDAC does not include the Jet Drivers which you are probably using.  Believe you also need the 3.51 version of (jet) driver as you are using Access 97.

I've not used VB with Excel so i can't help you on importing a spreadsheet.

Just to check, use this to identify the MDAC you are using and diagnose instalation issues.

http://www.microsoft.com/downloads/details.aspx?FamilyID=8f0a8df6-4a21-4b43-bf53-14332ef092c9&DisplayLang=en

I was not aware that MDAC_typ.exe 2.5 is installed by default on XP - I believed they installed a later MDAC. Anyway, you really just need the Jet drivers out of 2.5.

I don't think installing the VS SP4 (isn't it on SP5 now?) is going to help much on a target machine - not realistic everytime you deploy.

I would try some of these:

1. Identify which DLLs are not installing and why (in particular any that cause this "when the .dll file already exist, it won't let me replace it so I ignore the message")

2. Is your development machine on a w95 platform?  If so may be worth having clean install of development PC, put the correct version numbers of the DLLs you want to deploy in the redist folder (including the MDAC) (am assuming you are using PD Wizard), and considering using a later OS.

3. Do you still want to run this on W95? I would recommend targetting w98 and up, and getting the DLLs right for these.

4. If the code works 100% on w95, and when you test on a clean install of XP it doesn't, this has got to be either a DLL/Active X issue, or you are using some window function that was present in W95 that is no longer present in XP. try and identify the bit of code causing the problem (use MSGBOX if you have to). See which library this belongs to/reference or DLL. Investigate any changes that have occured in this library or if you need a later version to be compatible with XP.

Hope this helps

Raf
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8179755
BTW think the driver I was talking about is the Microsoft DAO 3.51 Object Library
0
 
LVL 1

Author Comment

by:babytam
ID: 8200431
Raf,

The DAO 3.51 is also installed when I installed the program and so did the MDAC file.  That's why I got the message saying that it's already installed.  And I believe the application was originally written in VB 6 on a Win 95 machine.  I checked for the versions of the dll files like you suggested, there were some differences for some files, then I copied the one from the Win 95 over to the Win XP, but I still got the same errors.

I think the creators of the program used the VB Deployment Wizard to create the setup file.  

I think the will try your next suggestion, looking through the code and try to identify where the errors occur.  I'll let you know if I know what's wrong.

Thanks,
Tam
0
 
LVL 1

Accepted Solution

by:
rafsalman earned 150 total points
ID: 8201562
Great - if you can identify any issues in code (or not) this should move you forward.  Does the program run ok on your development machine (i.e. under the development environment)? If so then the code is fairly certain to be ok unless you are using a part of the OS present in 95 but not in XP.

If it works fine here but fails to install on XP, it may be worth building a development machine using win 2k or XP and rebuilding the installer. By running Package & Deployment wizard you should be able to identify which DLLs it thinks you need - then as it is an old installer you will then have to work out which of these you should REMOVE (e.g. wininet.dll is standard on win 2k, XP and part of OS so is protected by the WFP - causing the installer to enter a restart loop.)

OK I wouldn't copy over W95 Dlls to XP - but this does not mean don't include those DLLs in the installer if they are not present in XP or if they are needed by 98 - the installer will allow you to avoid this if you are trying to install an older file.  I think targetting 95 as well will cause potential problems as it is a bit too far down the chain.  Proabl;y the easiest way is to compare version numbers for Me, 2k and XP using the DLL page on MSN, and always include the lowest version number in your installer (I may be repeating myself here).

Put these DLLs in the redist folder

C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist

Test the installer on a clean install of XP (nothing else installed).

If you did not make the installer yourself then it is probably time to do so to at least eliminate this from the list of problems.

0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8203145
http://support.microsoft.com/default.aspx?scid=kb;en-us;238401


This also may help you sort out which DLLs you're going to need.


Or you can trawl the rather large list of articles on Access 97 - Access 2002 incompatibilities. One is below.

it could be that things have changed since the app was originally programmed.

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B246237
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8219193
any luck babytam or have you given up ;)
0
 
LVL 1

Author Comment

by:babytam
ID: 8229421
raf,

not give up yet...I'm still trying to compile it from Win XP...but it giving me compile errors.....
0
 
LVL 1

Author Comment

by:babytam
ID: 8266999
raf,

I got some of the errors resolved.  Rerun the program from Win XP helps.  I had to changed some of the code be cause it's looking for some fields that don't exist in the table.

For this kind of error:
Run-time Error '-2147467259(80004005) Insufficient base table information for updating or refreshing.

I changed the table to query instead.  

I still need to reduce the margin of the report.  It seem smaller in Win XP than in Win 95.

Thanks for your help!

Tam
0
 
LVL 1

Author Comment

by:babytam
ID: 8267016
It's a start.  I do need to change some coding and change table to queries for updating records.  But do you know why not all VB6 is referencing to the same version of MS ActiveX Data Object library on each Win XP?  I had to change the version for one computer.
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8268015
Ok may be worth checking which you have selected under

Menu|Components and Menu|References

It is possible you have either not included a reference to the ActiveX object, included references to two different versions of the library, or (if on different OS) are using conflicting version numbers to that which the OS has installed as part of its protected operating system (e.g. Windows File Protection on Me, 2k and XP).

Check the file in this link to check if there is an OS issue

http://support.microsoft.com/default.aspx?scid=/servicedesks/fileversion/dllinfo.asp&SD=MSDN&FR=0


Raf
0
 
LVL 1

Author Comment

by:babytam
ID: 8273418
raf,

It's weird.  On one computer it compile fine if I used the ADO 2.0 (msdao20.tbl) and on the other computer it would give me compile error, but it's fine if i used ADO 2.7 (msdao15.dll)...and they're both Win XP.  And do you know why the application is not running consistantly?  Sometime the code behind the command button run fine.  Then sometimes when I reran it, the same command button gave me error message.....so odd?

Thanks,
Tam
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8290538
It's difficult to say - try running the code from the IDE on both systems and try to trace where the errors are coding (using breaks and F8 to narrow the range)

it could be something like having a recordset open when trying to open a transaction causing the error, or using a part of the code that has not been reinitialised.  If you type the error code into the immediate window it will give you the description of the error - use:

?error(n) where n is the error code.

Are both XP systems identical (same software installed?). Does your code when it exits leave all the settings in the expected state on start-up?  This would apply to things like registry settings or some sort of settings stored ina file.

I have a link somewhere which lists the components of the MDAC - are you distributing the whole mdac or just specific parts of the MDAc - this could be an issue and is not recommended by MS.

Will try and find link and get back to you - work emergency in progress!


0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8292714
MDAC Support Centre

http://support.microsoft.com/default.aspx?scid=fh;en-us;mdac


still can't find that link i really want to tell you !
0
 
LVL 1

Author Comment

by:babytam
ID: 8294277
Raf,

Do you really think it's the MDAC that's causing the problem?  The computer already have MDAC 2.7 installed and VB6 SP5 installed as well...should the later version suppose to have the fixes in the earlier version too?

Well, the two computers are different....one is Win XP for home and the other is for work...so I think there's some differences...

But regardless....I get this runtime error when it's not suppose to be there:

Error 3021: Either BOF or EOF is True, or the current record has been deleted.  Requested operation requires a current record.

The code where the error occurs varies...but they all within a loop with the statement contains .EOF ....I tried to add ErrorHandler and do a Resume next whenever the the error occur...This trick works...and it creates the same result when I compare it with the original application that runs on Win 95.

Another error when I tried to use the recordset.update is:

Error -2147217888:  Method 'Update' of object '_Recordset' failed.

I tried the same trick with the other error and it created the same result as the original application on Win 95.

Isn't the DMAC automatically included when I use the Package and Development Wizard?

Thanks,
Tam
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8298296
Can you give me some code on the EOF loop?

MDAC 2.7 is the latest version - but that doesn't mean it supports previous versions....

Believe 2.7 is part of XP.

However - 2.5 has jet drivers (dlls) and ADO drivers and is needed for apps using older versions of e.g. Access database backend.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;271908

therein is one of your problems - distribute 2.5 and test - if you distribute the whole thing it obeys WFP (windows file protection) and doesn't try and replace key operating OS files - so any of these there from 2.7 will not be affected, but missing ones will be installed.  use SP3.

now if you run PD Wizard it will tell you the key DLLs you need - some of these will be in the MDAC.  Take these out and deploy the MDAC instead (may need to manually add this to installer - put MDAC in the redist folder under VB.

The MDAC manifest seems to have gone from the MSDN site - not sure why

old link was

http://support.microsoft.com/default.aspx?scid=http://www.microsoft.com/data/mdacwfp.htm

Ok,

this is the link to check which files are deployed with which MDAC - may be worth comparing these and cross reference against what your code needs (you'll need to identify this either yourself (harder unless you wrote the whole thing or know the person who did) or by running PD Wizard.)



0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8298757
OK got some links for you - it appears that only 2.7 installs on XP with the Jet drivers in a seperate package (some are preinstalled)

MDAC Installation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html/data_mdacinstall.asp

Redistributing Microsoft Data Access Components
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html/msdn_redistmdac.asp

INFO: MDAC Version 2.6 and Later Do Not Contain Jet or Desktop ODBC Drivers
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q271908&id=Q271908

How to Install the Jet 4.0 Components
If you are installing MDAC 2.6 or 2.7, and also need to install the Jet components, you can download a redistributable version of Jet 4.0 Service Pack 3 (Jet40SP3_Comp.exe). See the instructions later in this article for the location of this download and instructions on how to install it.

Jet40SP3_Comp.exe is a complete set of Jet 4.0 components for Microsoft Windows 95, Microsoft Windows 98, and Microsoft Windows NT version 4.0. Jet40SP3_Comp.exe gives you the complete Jet 4.0 components up to Service Pack 3 (SP3). This is the same version of Jet that ships with Microsoft Windows 2000 and Microsoft Windows Millennium Edition (Me).

NOTE: You should only install Jet40SP3_Comp.exe when Jet 4.0 is not already installed by your operating system, an application, or Microsoft Access Data Components (MDAC) 2.5 Service Pack 1 (SP1) or earlier. Before installing Jet40SP3_Comp.exe, you need to install MDAC 2.6 or later.
0
 
LVL 1

Author Comment

by:babytam
ID: 8338211
Raf,

Thank you for all your help...!
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8339762
no problem - hope you can sort it out, or have sorted it out ;)
0
 
LVL 1

Author Comment

by:babytam
ID: 8343763
Raf,

I got most of the stuff solved.  But not The project is turned over to another person so I'm off the hook. :)
0
 
LVL 1

Expert Comment

by:rafsalman
ID: 8346676
Phew! Wish I could turn my project over to someone ;)
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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

752 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