How to use a TypeLib (TLB) file to avoid a broken reference to the ADOX library (msadox.dll)

Symtom: A VB or MS-Access application has been developed on a computer with MDAC 2.7 (or newer) installed. When this application is run on a computer with an older version of MDAC (e.g. 2.5) installed, the reference to msadox.dll ("Microsoft ADO Ext. 2.7 for DLL and Security") is broken.

Cause: The ADOX libraries (msadox.dll) of different versions of MDAC have the same GUID ({00000600-0000-0010-8000-00AA006D2EA4}) but different interface version numbers. For the ADO library, the solution is to use the 2.5 TypeLib (msado25.tlb) in the references instead of the DLL (e.g. msado15.dll) (refer to MS-KB Q259379). But for the ADOX library, there is no TypeLib available from Microsoft.

Solution: The "TYPELIB" resource data from an old ADOX DLL can be extracted into a File (using a tool like EZ Extract Resource (use the "View" button to select the DLL and extract the TYPELIB resource)). When this type library file (e.g. msadox25.tlb) is used in the references of the application instead of the new DLL (msadox.dll), the application can be developed on a system with a new MDAC and is compatible with systems that have an older MDAC.

Note: If you had an old version of ADO (e.g. 2.5) installed on your computer before the new version was installed, it may not be possible to add the typelib file of the old version (msadox25.tlb) to your VB project references, because an entry with that name ("Microsoft ADO Ext. 2.5 for DDL and Security") is already in the list and points to the new DLL (msadox.dll). To solve this problem, delete the old entry in the Windows registry (using regedit.exe). For 2.5 (msadox25.tlb) the following registry key must be deleted: "HKEY_CLASSES_ROOT\TypeLib\{00000600-0000-0010-8000-00AA006D2EA4}\2.5"

Downloadable files:
  msadox25.tlb (for compatibility with Windows 2000 or newer (>= ADO 2.5))
  msadox21.tlb (for compatibility with NT4, Office 2000 or newer (>= ADO 2.1))

Author: Christian d'Heureuse (www.source-code.biz, www.inventec.ch/chdh)
Index