12

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!

Loki70
  • 613
  • 4
  • 15
  • 36
  • 4
    I hate this issue. I'm currently using a virtual Windows XP machine solely to compile ADO-related stuff. – GSerg Aug 11 '11 at 16:16
  • 1
    Check the events log for the reason the regtlibv12 command failed. Also did you launch your cmd window as the administrator? – jac Aug 11 '11 at 20:03
  • This has stumped me for quite some time, good to know i'm not the only one! – Jamie Keeling Jan 10 '12 at 14:38

3 Answers3

13

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.

Bob77
  • 13,167
  • 1
  • 29
  • 37
  • Great suggestion, Bob. I was able to successfully add the reference within my project. However, it did not "register" it for other projects - I had to add it to each project manually. This is 10X better than my previous solution (using a XP VM to build apps). Thank you very much for your solution! – Loki70 Aug 15 '11 at 01:26
  • Go to `C:\Program Files (x86)\Microsoft Visual Studio\VB98` and right click `VB6.EXE`. Select `Run as administrator`. Repeat steps from answer to permanently register the TLB. – wqw Aug 15 '11 at 11:41
  • wqw - You suggestion worked well. Once I followed your procedure, the TLB seemed to be permanently registered. Thank you vey much! – Loki70 Aug 15 '11 at 15:06
  • 1
    Yes, what wqw suggested is what it means to run something elevated. By the way, VB6.exe should always be run elevated for reliable operation because it requires debugging rights and registers things as you work. To do this you add an elevation manifest to it or navigate to VB6.exe, right click, and check "Run this program as an administrator" on the Compatibility tab of the Properties dialog. – Bob77 Jan 11 '12 at 13:15
  • See the answer here (http://stackoverflow.com/a/9824958/61989) for the updated solution, Microsoft has removed the workaround recommended by the accepted answer – Patrick McDonald Oct 09 '15 at 09:31
8

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.

ta.speot.is
  • 26,914
  • 8
  • 68
  • 96
  • 1
    Good point - I did NOT rename the file after downloading it and the instructions mention registering it without the "_i386". As I have it working now, I am not about to undo anything, but this is a good suggestion. – Loki70 Sep 23 '11 at 13:27
3

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.

Tim Lentine
  • 7,782
  • 5
  • 35
  • 40