Easysoft ODBC-ODBC Bridge

How does the OOB locate DSNs?

Last Reviewed:
28th October 2008

In Windows, the OOB client uses the {Get|Set}PrivateProfileString interface to save and retrieve DSN attributes. Therefore, all data sources should be set up with the ODBC Data Source Administrator.

In non-Windows platforms the data source are stored in a text file. The OOB client searches for this text file using the following order:

ODBCINI (environment variable)
<cwd>.odbc.ini (UNIX only, not VMS)
<home>.odbc.ini (UNIX only, not VMS)
/etc/odbc.ini (SYS$ROOT:odbc.ini for VMS) - system DSNs only
<wherever unixODBC stores DSNs>

Where <cwd> is the current working directory and <home> is the current users home directory (the HOME environment variable then /etc/passwd entry in UNIX or SYS$LOGIN in OpenVMS).

If the OOB client cannot find the DSN in the fixed locations it will attempt to load the unixODBC libodbcinst shared object and use SQLGetPrivateProfileString(). In this way, if you built unixODBC yourself with a different --sysconfdir, OOB can still find your DSNs.

The OOB server has no need to lookup DSNs or DSN attributes as it is acting as an application talking to either a driver manager or an ODBC driver directly (of course this changes when you are running the OOB Server on non-Windows machines).

If you are running Apache/PHP built with the OOB, Easysoft recommend you use /etc/odbc.ini because [1] this is more secure as it is out of your htdocs directory [2] it avoids possible problems when starting Apache in a directory other than where your odbc.ini file is located. See question "Apache/PHP can't seem to find my odbc.ini file or Datasource not found and no default driver error".

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.