HOWTO: Determine Which ODBC Files to Ship

ID: Q129459


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), included with:
    • Microsoft Visual C++ for Windows, 16-bit edition, versions 1.50, 1.51, 1.52
    • Microsoft Visual C++, 32-bit Editions, versions 2.0, 2.1, 2.2, 4.0, 4.1, 4.2


SUMMARY

This article discusses how to determine which ODBC and ODBC driver files to ship with a Visual C++ application that uses the MFC database classes. This information is more specific than that found in the REDISTRB.WRI file.


MORE INFORMATION

There are two categories of files that must be shipped with an application that uses the MFC database classes:

  • The ODBC components.


  • The files that make up the ODBC driver(s) that the application uses.


ODBC Components

The set of ODBC components that you need to ship depends on the operating system supported and on whether the application is a 16-bit or a 32-bit application. The possible combinations are described in more detail in Appendix A of the ODBC SDK Guide (ISBN #:1-55615-658-8). The four possible combinations and their required ODBC component files are:

   16-bit Application with 16-bit Drivers (Windows 3.1 and Windows NT)
   -------------------------------------------------------------------

   ODBC.DLL           16-bit driver manager
   ODBCCURS.DLL       16-bit cursor library
   ODBCINST.DLL       16-bit installer DLL
   ODBCADM.EXE        16-bit administrator
   ODBCINST.HLP       installer help file
   CTL3DV2.DLL        16-bit ctl3d DLL

   16-bit Application with 32-bit Drivers (Windows NT)
   ---------------------------------------------------

   ODBC.DLL           16-bit driver manager
   ODBCCURS.DLL       16-bit cursor library
   ODBC16GT.DLL       16-bit ODBC generic thunking DLL
   ODBC32GT.DLL       32-bit ODBC generic thunking DLL
   ODBCINST.DLL       16-bit installer DLL
   ODBCCP32.DLL       32-bit installer DLL
   ODBCADM.EXE        16-bit administrator
   ODBCAD32.EXE       32-bit administrator
   ODBCINST.HLP       installer help file
   DS16GT.DLL         16-bit driver setup generic thunking DLL
   CTL3D32.DLL        32-bit ctl3d DLL

   32-bit Application with 16-bit Drivers (Win32s)
   -----------------------------------------------

   ODBC32.DLL         32-bit thunking driver manager
   ODBCCURS.DLL       16-bit cursor library
   ODBC.DLL           16-bit driver manager
   ODBC16UT.DLL       16-bit ODBC universal thunking DLL
   ODBCCP32.DLL       32-bit thinking installer DLL
   ODBCINST.DLL       16-bit installer DLL
   CPN16UT.DLL        16-bit installer universal thunking DLL
   ODBCADM.EXE        16-bit administrator
   ODBCINST.HLP       installer help file
   CTL3DV2.DLL        16-bit ctl3d DLL

   NOTE: The Win32s components are included in the \WIN32S\ODBC
   directory on the Visual C++ version 2.X and 4.X CDs.

   32-bit Application with 32-bit Drivers (Windows NT)
   ---------------------------------------------------

   ODBC32.DLL         32-bit driver manager
   ODBCCR32.DLL       32-bit cursor library
   ODBCCP32.DLL       32-bit installer DLL
   ODBCAD32.EXE       32-bit administrator
   ODBCINST.HLP       installer help file
   CTL3D32.DLL        32-bit ctl3d DLL 

ODBC Drivers

The files that make up the different ODBC drivers are not documented completely in any one place. Because of this lack of documentation and also because these files are prone to change in the future, a good way to determine which files are needed to redistribute a particular driver is to use the ODBC.INF file for the setup program that initially installed the ODBC driver files. The advantage of using ODBC.INF is that it was actually used to install the ODBC drivers, therefore it is the source of a tested and working driver installation. For all versions of Visual C++ that ship ODBC components and drivers, ODBC.INF is located in the REDIST subdirectory.

For example, suppose an application needs to install the Microsoft Access driver that ships with Visual C++ version 1.52a. In that case, you would look in the "[Microsoft Access Driver (*.mdb)]" of the ODBC.INF file. In this section, you will see a number of entries, one for each file that makes up the Microsoft Accesss driver. Each entry is on a single line that consists of comma-separated values. The second value in each line is the filename for that entry. Here is the first entry for the Microsoft Access driver section of ODBC.INF:

"vbajet.dll" = 1, vbajet.dll,,,, 1994-11-18,,,,,,,,,, 1984,,,, 2.0.0.2420,

In this case, you can see that the filename for this entry is VBAJET.DLL, so this is one of the files needed to redistribute the Microsoft Access driver. Another interesting field in this entry is the next to the last one (2.0.0.2420). This is the version number of the file.

Going through all the entries in the Microsoft Access driver section, you can make a list of all the required files:
VBAJET.DLL
STDOLE.TLB
OLE2.REG
MSJETERR.DLL
MSJETINT.DLL
OLE2PROX.DLL
VAEN2.OLB
OLE2CONV.DLL
ODBCTL16.DLL
COMPOBJ.DLL
OLE2NLS.DLL
ODBCJTNW.HLP
OLE2DISP.DLL
STORAGE.DLL
ODBCJET.HLP
TYPELIB.DLL
ODBCJT16.DLL
OLE2.DLL
VBAR2.DLL
MSAJT200.DLL
NOTE: Many of these files are OLE2 DLLs. It is very important to do version checking when installing files on a new system. If there are newer versions of any of these files and you replace them with older versions, applications that depend on the newer versions may break.


REFERENCES

ODBC 2.0 SDK GUIDE, Appendix A, Developing 16- and 32-Bit Applications and Drivers (ISBN #:1-55615-658-8).

Additional query words: 2.50 2.51 2.52 2.52a 3.00 3.10 3.20

Keywords : kbsetup kbDatabase kbMFC kbODBC kbVC
Version : 1.5 1.51 1.52 1.52a 2.0 2.1 2.2
Platform : NT WINDOWS
Issue type : kbhowto


Last Reviewed: July 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.