INFO: ODBC Configuration Runtime Notes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Support
    Forum Member
    • Jan 2000
    • 204

    INFO: ODBC Configuration Runtime Notes

    INFO: ODBC Configuration Runtime Notes

    INFO: ODBC Configuration Runtime Notes

    Document ID: IR02044
    The information in this article applies to:
    • Setup Factory 6.0

    SUMMARY

    This article describes how you can install ODBC on a user’s system and configure ODBC drivers and Data Sources using Setup Factory 6.0.

    DISCUSSION

    Module Description

    The Setup Factory 6.0 ODBC configuration module will install the following files into your Setup Factory 6.0 directory:

    ...Setup Factory 6.0\InstallODBC.exe
    ...Setup Factory 6.0\ODBCConfig.ini
    ...Setup Factory 6.0\ODBCConfig.htm

    InstallODBC.exe

    Indigo Rose Corporation provides the InstallODBC.exe program for use free of charge in your Setup Factory 6.0 setups. When run, InstallODBC.exe will look for a configuration file named InstallODBC.ini that must be located in the same directory as InstallODBC.exe. InstallODBC.exe will read in the settings from the InstallODBC.ini file and then configure ODBC appropriately.

    Note: InstallODBC.ini is simply ODBCConfig.ini renamed.

    ODBCConfig.ini/InstallODBC.ini

    InstallODBC.ini is the configuration file that InstallODBC.exe needs in order to know "what to do". The commands stored in InstallODBC.ini will be interpreted by InstallODBC.exe, and the executable will pass the commands to certain functions in the ODBC DLL: odbccp32.dll.

    For example the [Data Sources] section of the InstallODBC.ini file is used to configure ODBC data sources. InstallODBC.exe will read the information from this section and then pass it to "SQLConfigDataSource" function in odbccp32.dll.

    When you want to use InstallODBC.exe you should make a copy of ODBCConfig.ini and rename it to InstallODBC.ini. ODBCConfig.ini must be located in the same directory as InstallODBC.exe, in order for InstallODBC.exe to function properly.

    Note: In order to work properly both the executable and the INI file need to have the same name. For example if InstallODBC.exe was renamed to mark.exe and ODBCConfig.ini to mark.ini everything would function properly.

    The InstallODBC.ini file has the following sections:

    [IndigoRose]

    This section is for identification and information purposes only. You should never edit this section as the program will not run properly if it is changed.

    [Settings]

    This section allows you to specify the GUI settings for the InstallODBC.exe program. The Title= value lets you specify the text that will appear in the title bar of the InstallODBC.exe program’s window. The LoadMessage= line allows you to specify the text that should appear in the actual window.

    [InstallManager]

    This section allows you to specify if the InstallODBC.exe program should configure the driver manager. The Install= value tells InstallODBC.exe whether or not it should install the driver manager. This option is usually not necessary because the MDAC install will do this for you. This command is equivalent to calling SQLInstallDriverManager from the installer DLL.

    [Drivers]

    This section lets you specify ODBC drivers that should be configured. Please note that this does not install the driver files themselves but rather it configures the installed driver file. Most common ODBC drivers will be automatically installed and configured by the MDAC setup. The drivers that you specify here will be configured using the SQLInstallDriverEx function in odbccp32.dll. Please see the InstallODBC.ini file’s comments and examples for more details about using this section.

    [Data Sources]

    This section lets you specify ODBC data sources that should be configured. Please note that this does not install the database files themselves but rather it configures the data sources in ODBC for the databases. The data sources that you specify here will be configured using the SQLConfigDataSource function in odbccp32.dll. Please see the InstallODBC.ini file’s comments and examples for more details about using this section.

    ODBCConfig.htm

    ODBCConfig.htm is this file. It is a general reference guide and description of the Setup Factory 6.0 ODBC configuration module.

    Developer Notes

    Installing ODBC

    Setup Factory 6.0 supports the installation of ODBC through the Microsoft Data Access Components (MDAC). Setup Factory 6.0 has built-in runtime support for MDAC 2.6. The Setup Factory 6.0 MDAC 2.6 runtime support module can be downloaded from: http://www.indigorose.com/setup/support/runtimes.html

    Note: The Setup Factory 6.0 MDAC 2.6 runtime support module will force your user's system to reboot. If you decide to use the MDAC 2.6 runtime support module then you should use a Run on Reboot action to launch InstallODBC.exe.

    Using InstallODBC.exe in Your Setup

    Once you have configured the ODBCConfig.ini file and renamed it to InstallODBC.ini, add it and the InstallODBC.exe to your Setup Factory project. Set their destinations to be the same location. For the purpose of simplicity we will assume that InstallODBC.exe and InstallODBC.ini will be installed to: %AppDir%\Config for the remainder of this article.

    Now we have to determine when we want to launch InstallODBC.exe. If your user's system needs to be rebooted (perhaps you are using Setup Factory's MDAC 2.6 runtime support module), we will use a Run on Reboot action to launch it. If the user does not need MDAC 2.6 installed on their system then we will simply use an Execute File action, on the Shutdown event.

    What we will do in order to determine if our user's system will be rebooted is check the value of the %DoReboot% built-in variable. If %DoReboot% is equal to TRUE we will use a Run on Reboot action, and if %DoReboot% is equal to FALSE we will use an Execute File action. It is recommended that these actions be placed on the Shutdown tab of the Actions dialog.

    The Run on Reboot action will look something like this:

    File to Run: %AppDir%\InstallODBC.exe
    Command line arguments:

    The Execute File action will look something like this:

    File to execute: %AppDir%\InstallODBC.exe
    Command line arguments:
    Working directory: %AppDir%
    Run mode: Normal
    Wait for program to finish running before continuing: Unchecked

    Once you are finished the actions necessary to launch InstallODBC.exe, it will look something like this:

    If (%DoReboot% = TRUE)
    Run File on Reboot (%AppDir%\InstallODBC.exe)
    END IF
    If (%DoReboot% = FALSE)
    Execute (%AppDir%\InstallODBC.exe)
    END IF

    The above actions will insure that InstallODBC.exe is executed properly; either right after the installation has completed or after the user's system has rebooted.

    Note: Be sure to test your installation on a variety of operating systems and configurations to make sure that it functions properly.

    MORE INFORMATION

    For more information please see the following resources:

    KEYWORDS: Setup Factory 6.0, ODBC


    Last reviewed: October 30, 2002
    Copyright © 2002 Indigo Rose Corporation. All rights reserved.
Working...
X