PDA

View Full Version : INFO: ODBC Configuration Runtime Notes



Support
10-30-2002, 02:22 PM
<HTML><HEAD><TITLE>INFO: ODBC Configuration Runtime Notes</TITLE></HEAD><BODY><h3>INFO: ODBC Configuration Runtime Notes</h3><b>Document ID: IR02044</b><hr>The information in this article applies to:<ul><li>Setup Factory 6.0</li></ul><hr><h3>SUMMARY</h3><p>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.</p><h3>DISCUSSION</h3><p><b>Module Description</b></p><p>The Setup Factory 6.0 ODBC configuration module will install the following files into your Setup Factory 6.0 directory:</p><pre><code>...Setup Factory 6.0\InstallODBC.exe<br>...Setup Factory 6.0\ODBCConfig.ini<br>...Setup Factory 6.0\ODBCConfig.htm</code></pre><p><b>InstallODBC.exe</b></p><p>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.</p><p><b>Note:</b> InstallODBC.ini is simply ODBCConfig.ini renamed.</p><p><b>ODBCConfig.ini/InstallODBC.ini</b></p><p>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. </p><p>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.</p><p>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.</p><p><b>Note:</b> 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.</p><p>The InstallODBC.ini file has the following sections: </p><pre><code>[IndigoRose]</code></pre><p>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.</p><pre><code>[Settings]</code></pre><p>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.</p><pre><code>[InstallManager]</code></pre><p>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.</p><pre><code>[Drivers]</code></pre><p>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. </p><pre><code>[Data Sources]</code></pre><p>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.</p><p><b>ODBCConfig.htm</b></p><p>ODBCConfig.htm is this file. It is a general reference guide and description of the Setup Factory 6.0 ODBC configuration module.</p><p><b>Developer Notes</b></p><p><b>Installing ODBC</b></p><p>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: <A HREF="http://www.indigorose.com/setup/support/runtimes.html" target="blank">http://www.indigorose.com/setup/support/runtimes.html</a></p><p><b>Note:</b> 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 <b>Run on Reboot</b> action to launch InstallODBC.exe.</p><p><b>Using InstallODBC.exe in Your Setup</b></p><p>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.</p><p>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 <b>Run on Reboot</b> action to launch it. If the user does not need MDAC 2.6 installed on their system then we will simply use an <b>Execute File</b> action, on the Shutdown event.</p><p>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 <b>Run on Reboot</b> action, and if %DoReboot% is equal to FALSE we will use an <b>Execute File</b> action. It is recommended that these actions be placed on the Shutdown tab of the <i>Actions</i> dialog.</p><p>The <b>Run on Reboot</b> action will look something like this:</p><pre><code><b>File to Run:</b> %AppDir%\InstallODBC.exe<br><b>Command line arguments:</b> </code></pre><p>The <b>Execute File</b> action will look something like this:</p><pre><code><b>File to execute:</b> %AppDir%\InstallODBC.exe<br><b>Command line arguments:</b><br><b>Working directory:</b> %AppDir%<br><b>Run mode:</b> Normal<br><b>Wait for program to finish running before continuing:</b> Unchecked</code></pre><p>Once you are finished the actions necessary to launch InstallODBC.exe, it will look something like this:</p><pre><code>If (%DoReboot% = TRUE)<br> Run File on Reboot (%AppDir%\InstallODBC.exe)<br>END IF<br>If (%DoReboot% = FALSE)<br> Execute (%AppDir%\InstallODBC.exe)<br>END IF</code></pre><p>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.</p><p><b>Note:</b> Be sure to test your installation on a variety of operating systems and configurations to make sure that it functions properly.</p><h3>MORE INFORMATION</h3><p>For more information please see the following resources:</p><ul><li>Setup Factory 6.0 Runtime Support modules: <A HREF="http://www.indigorose.com/products/setup_factory_modules_1.php" target="blank">http://www.indigorose.com/products/setup_factory_modules_1.php</a></li><li>Microsoft's ODBC homepage: <A HREF="http://www.microsoft.com/data/odbc/default.htm" target="blank">http://www.microsoft.com/data/odbc/default.htm</a></li><li>MSDN ODBC Programmers reference: <A HREF="http://msdn.microsoft.com/library/en-us/odbc/htm/odbcabout_this_manual.asp" target="blank">http://msdn.microsoft.com/library/en-us/odbc/htm/odbcabout_this_manual.asp</a></li><li><b>Command Reference | Actions | Individual Actions | IF</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | END IF</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | Execute File</b> in the Setup Factory 6.0 help file</li><li><b>Command Reference | Actions | Individual Actions | Run on Reboot</b> in the Setup Factory 6.0 help file</li></ul><p>KEYWORDS: Setup Factory 6.0, ODBC</p><hr><FONT SIZE=1>Last reviewed: October 30, 2002<br>Copyright © 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>