Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting VB6 ADO application to work in Windows 7

Tags:

windows-7

vb6

ado

I have inheritted several old VB6 applications that currently cannot be rewritten in .NET. These old applications all use ADO, and compile fine on my XP machine. Since switching to a Windows 7 machine, the applications compile fine, but when they are deployed (on XP machines), I get errors. This is a known issue that this Microsoft article discusses:

http://support.microsoft.com/kb/2517589

The article give a very detailed explanation of a workaround, which involved copying a ".TLB" file and registering it using "regtlibv12". When I attempt to register it, I get this error message:

RegisterTypeLib of C:\Program Files\Common Files\System\ado\msado60_Backcompat.tlb failed : 80029c4a

I have also tried registering this using the old "regtlib.exe" in the Windows folder, but got this error:

LoadTypeLib of C:\Program Files\Common Files\System\ado\msado60_Backcompat.tlb failed : 80029c4a

Because of this, I cannot continue with the work around. I would greatly appreciate any guidance anyone could give me on how to properly register this file.

Thank you in advance!

like image 743
Loki70 Avatar asked Aug 11 '11 14:08

Loki70


3 Answers

Put the .TLB file in an appropriate place like

C:\Program Files\Common Files\System\ado

Then open a new Project in the VB6 IDE (elevated, i.e. as admin). Choose Project|References... then click the Browse button. Navigate to the new .TLB file and open it. Check the box to select the item and close the References dialog.

It should be registered now.

If desperate, try VB Type Library Registration Utility.

like image 74
Bob77 Avatar answered Nov 09 '22 04:11

Bob77


You probably downloaded the file as C:\temp\Msado60_Backcompat_i386.tlb and didn't rename it. The example is for registering C:\temp\Msado60_Backcompat.tlb (note, no _i386).

Run the command with the correct filename.

like image 29
ta.speot.is Avatar answered Nov 09 '22 03:11

ta.speot.is


Just to update this answer list based upon more recent information, Microsoft released KB 2640696 which addresses this issue in a more straightforward manner. This patch makes it much easier to deploy on your build machines and solves the downlevel OS issue as well.

A more complete picture of the patch can be found on the following blog post.

like image 41
Tim Lentine Avatar answered Nov 09 '22 04:11

Tim Lentine