SAMPLE: ODBC 3.0 Installation

ID: Q174191

The information in this article applies to:

SUMMARY

This document describes how to use the ODBC 3.0 setup program Odbcinst.exe.

The ODBCINST sample demonstrates the use of the ODBC 3.0 Installer DLL API to install ODBC Core, Driver, and Translator components. The sample implements a fully functional installation program, written using MFC, that can operate in either GUI mode or in silent mode. The sample is designed to run on Windows 95 and Windows NT.

The sample uses the Windows 32 Setup API to implement an .inf file-driven installation that the user can modify to support the installation of different ODBC 3.0 components without any changes to the program code.

This article deals with redistribution of Microsoft Data Access Components (MDAC), which includes ODBC, OLE DB, ADO, RDS, the MDAC Standalone, MDAC Redistribution and the Data Access SDK. The "Redistributing Microsoft Data Access Components" whitepaper presents a comprehensive overview of this subject, including referencing the content in this article. This whitepaper is located at:

   http://www.microsoft.com/msdn/news/feature/datajul98/redistmdac.htm

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ ODBCInst.exe (size: 2500905 bytes) 


Release Date: Jun-04-1998

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

ODBC Drivers Used in Sample Demonstration

The following ODBC components are supplied with the sample:

Microsoft assumes that any user who downloads this sample has a valid license for these drivers. Use of the sample implies compliance with this expectation. These drivers are not freely redistributable, and require that a user have a valid Microsoft Development Tool that provides the license for redistribution.

Running the Program

The Odbcinst.exe program has two modes of operation: GUI mode and silent mode. GUI mode operation causes the program to present a dialog box that prompts you to select which ODBC components to install. Silent mode operation causes the program in install all ODBC components specified in the ODBC.INF file without any input from the user.

NOTE: Odbcinst.exe assumes that the files being installed are in the same directory that it is being run from.

By default the Odbcinst.exe runs in GUI mode. Specifying the /s option on the command line causes the program to run in silent mode. Following is a summary of the command line options:

Command Line Options:

ODBCINST [/s] /s - Run the program in silent mode

When Odbcinst.exe finishes execution, it will return a numeric value indicating the status of the installation process. Following are the possible return codes and their meanings:

Return codes:

 > 0  An error occurred during setup. The return code is the Windows 32
      error number.

   0  The setup program ran to completion with no errors.

  -1  The user cancelled the setup program before completion.

  -2  Some files were in use and the computer needs to be restarted before
      the installation is complete.

ODBC Installation Configuration File ODBC.INF

The Odbcinst.exe is designed to allow the user to specify which ODBC 3.0 components are installed without making any changes to the Odbcinst.exe program code. Edit the ODBC.INF file to add or remove a component from the list of components that are installed. For information on editing this file see the comments in the supplied ODBC.INF file and the documentation for the Setup API in the Win 32 Platform SDK.

Selecting which Oracle ODBC Driver to Use

The setup includes support for the "Microsoft ODBC Driver for Oracle" version 1.0 (File Version 2.00.006325) and the "Microsoft ODBC for Oracle" driver version 2.0 (File Version 2.73.725300). This is because Oracle ODBC Driver Version 1.0 works with only Oracle Version 7.2 or later and Version 2.0 works with only Oracle Version 7.3.3.0 or greater.

Additional query words: kbDSupport kbdse kbMFC kbDatabase kbODBC CCheckListBox ODBC 3.0 Setup API

Keywords          : kbfile kbsample
Version           : WINNT:97
Platform          : winnt
Hardware          : x86

Last Reviewed: August 7, 1998