Connections to a data source can be made via a connection string without referring to a data source name (DSN-less connections). This is accomplished by specifying the "DRIVER=" instead of the "DSN=" keyword in a connection string as outlined in the ODBC specification. For this to work on UNIX and Linux, a file called odbcinst.ini must exist when the driver encounters DRIVER= in a connection string.

For complete details about the odbcinst.ini file, refer to the chapter "Configuring the product on UNIX/Linux" in the user’s guide for your driver.

By default, the Progress DataDirect product Setup installs a sample odbcinst.ini file in the same location, install_directory, as the sample odbc.ini file (see "Adding entries to odbc.ini file" for an explanation of the odbc.ini file). Your installation program must create or modify a similar odbcinst.ini file for you to be able to make DSN-less connections and/or use the Linux ODBC Administrator.

Use the following procedure:

  1. Your installation program must first create the odbcinst.ini file.
  2. The program must next create the [ODBC Drivers] section in the odbcinst.ini file. One line is required in the [ODBC Drivers] section for each installed driver. This line consists of the driver name and an equal (=) sign, followed by the word "Installed." For example:
    [ODBC Drivers]
    DataDirect MongoDB=Installed 

    Specify a descriptive name for each installed driver.

  3. For each driver listed in the [ODBC Drivers] section, your program must create a section named with the driver name, which contains a Driver= setting to specify the path to the driver, as well as other specifications.
    The following keywords are required for relational databases:
    APILevel

    ConnectFunctions

    Driver

    DriverODBCVer

    FileUsage

    HelpRootDirectory (UNIX Administrator only)

    Setup (UNIX Administrator only)

    SQLLevel

    The following example illustrates these keywords for the MongoDB driver, using cd as the prefix for the driver file name (nn would be replaced with the driver level number):

    [DataDirect MongoDB]
    Driver=ODBCHOME/lib/cdmongonn.so
    APILevel=1
    ConnectFunctions=YYY
    DriverODBCVer=3.52
    FileUsage=0
    HelpRootDirectory=ODBCHOME/help/MongoDBHelp 
    Setup=ODBCHOME/lib/cdmongonn.so 
    SQLLevel=1 

    The HelpRootDirectory and Setup keywords are only required if you want to use context-sensitive driver help through the Linux ODBC Administrator GUI. Your program must replace ODBCHOME with the path to the product installation directory. Note also that for most drivers, the Setup= keyword has the same value as the Driver= keyword. For certain drivers, the Setup= keyword has the same value as the Driver= keyword except for the addition of an S before the file name extension.

    Refer to the chapter "Configuring the product on UNIX/Linux" in the driver's user’s guide for a sample odbcinst.ini file that includes all the correct Setup values.

  4. You must instruct the user to set the ODBCINST environment variable. This variable specifies the location of the odbcinst.ini file. For example:
    setenv ODBCINST /home/allusers/everyone.odbcinst.ini      

    causes the driver to look for the file named everyone.odbcinst.ini in the /home/allusers directory.

    If the ODBCINST variable is not set, the driver looks in the user’s home directory for a file named odbcinst.ini. If the driver does not find the file, it returns the message:

    HY000 - "ODBCINST.INI is not available in the directory pointed to by the  
    ODBCINST environment variable (or the current user's HOME directory) and  
    therefore DSN-Less connections cannot be made."