Close menu

odbc.dsn

The odbc.dsn configuration file specifies the data sources and data source specific configuration.

The location (and name) of the odbc.dsn configuration file is configured in the odbc.cfg ([config] dsnFile).

The odbc.dsn file defines any number of data sources. Each data source uses a different section, enclosed in square brackets. The data source name is not case sensitive.

The example below defines the data sources "Data source 1" and "Test".

[Data source 1]
Database = ...
...

[Test]
Database = ...
...


The following configuration items are recognized for each data source:


Database
The name and address of the database. The database name consists of the following elements:
[[host][:service]/]database
  • The host name or IP address on which the database server resides. The default is the local system (localhost or IP address 127.0.0.1).

  • The service name or port number which is used by the server process on that machine. The default is defined by the service name eloqdb.

  • The database name. If the host name or service is specified it is separated with a slash from the database name.

Multiple databases may be specified for a data source. For each database a Login and Password may be specified.

For example:

[Sample]
database = db1
login = dbuser
database = db2
database = db3
This specifies a data source consisting of three databases. The database login "dbuser" is used for all databases.

Note:

  • On HP-UX the database name may alterntively specify the path of the ROOT file to indicate an Eloquence A.05.xx database.
    /path/to/DATABASE
    

Login
The database user login. This configuration item is optional and may be specified for each database. If a login is specified it is used to authorize with the database server when opening the database. If a login is not specified either the login of the previously specified database (in the same data source) is used or the default "public" login.

Notes:

  • The Login config item has no effect if security = db is specified. In this case the user specified login and password is used to authorize with the database server.

Password
The database password in clear text. This item may be omitted or left empty if not required by the database.

Notes:

  • The Password config item has no effect if security = db is specified. In this case the user specified login and password is used to authorize with the database server.
  • The PassKey config item may be used to avoid using clear text passwords.

Passkey
Refers to a password key defined in the odbc.pswd file. This is an alternative to using the Password item.
The odbc.pswd file stores passwords in encrypted form and is maintained with the sqlrpasswd utility. See also ...

For example:

[Sample_DSN_using_Passkey]
Database = sample
Login = test
passkey = test
...

Alias
Specifies an alternative name for the database. When an alias name is defined, it will be provided to the ODBC client instead of the original data base name. The data base name (or alias) may be used by the application to qualify the data base.

Repository
The path and name of a repository file (optional). Repository files are associated with the data source and are processed after all data bases have been opened successfully. Multiple repository files may be specified.

GroupReadList
GroupWriteList
List of comma-separated group names. Multiple GroupReadList and/or GroupWriteList entries are recognized per data source.

If configured and the connecting user is member of a group that matches a name in GroupReadList and/or GroupWriteList, access is granted.
If not configured or if the user is not in a matching group UserList and WriteList come into effect.

  • If Security = odbc is configured, users may be associated with arbitrary group names in the odbc.user file, using the GroupList user configuration item.

  • If Security = ldap is configured, group names and membership are obtained from the LDAP server.

  • The GroupReadList and GroupWriteList items have no effect if security = db is configured.

Read-only access is granted if a group is listed in GroupReadList. Read/write access is granted if it is listed in GroupWriteList, according to the setting of the EnableWrite configuration item. If EnableWrite is not configured, limited read/write access is granted.
If a group is listed in both lists, the GroupWriteList entry takes precedence so that read/write access is granted.

Notes:

  • The GroupReadList and GroupWriteList items have no effect if security = db is configured. In this case the user specified login and password is used to authorize with the database server and defines data access.

UserList
WriteList
List of comma-separated user names. Multiple UserList and/or WriteList entries are recognized per data source.

If one or both of these lists are present, they restrict which users are authorized to access the data source.

Read-only access is granted if a user is listed in UserList. Read/write access is granted if it is listed in WriteList, according to the setting of the EnableWrite configuration item. If EnableWrite is not configured, limited read/write access is granted.

If a user is listed in both lists, the UserList entry takes precedence so that read-only access is granted.

Notes:

  • The UserList and WriteList items have no effect if security = db is configured. In this case the user specified login and password is used to authorize with the database server and defines data access.

EnableWrite
Specifies if the database is available for write access. One of the following values: readonly, limited, full

  • readonly - specifies read-only access to the database

  • limited - specifies that explicit transactions must be used. This limits any write access to programs that are specifically adapted.

    full - specifies that the datasource should support ODBC compliant transaction handling

The default is "readonly" or "limited" if a WriteList configuration item is present.

Notes:

  • The EnableWrite item has no effect if security = db is configured. In this case the user specified login and password is used to authorize with the database server and defines data access.

PrimaryKeys
Specifies if the SQLPrimaryKeys() call should return a result. One of the following values: yes, no
The default is yes. Setting this to "no" may be useful with some ODBC enabled applications that use the MS Jet Engine.

UseDouble
Specifies if the server returns the SQL_DOUBLE type. One of the following values: yes, no
The default is yes. When set to no, the ODBC server does not return the SQL_DOUBLE type and uses SQL_FLOAT instead.

RowidName
Name of the column that maps to the record number. The default is "ROWID".

For example:

RowidName = RECNO

UseLocks
Specifies if database locks should be automatically acquired on write operations. When configured a database lock is acquired before writing to the database.

One of the following values: no, set, db
The default is no.

  • no - specifies that database locks should not be automatically acquired. This will increase concurrency but may result in failed write statements due to concurrent locks.

  • set - specifies to acquire a set level database lock on database write calls (DBLOCK mode 3).

  • db - specifies to acquire a database level lock on database write calls (DBLOCK mode 1).

This configuration item applies to all databases in the data source.

EscapeChar
Specifies the character that is used to escape quotation marks in string values. If not configured, the default backslash escape character is in effect. If EscapeChar is configured but empty, escaping is disabled altogether.

Please note that the standard quotation mark escaping (use two subsequent quotation marks to include a single quotation mark) always works regardless of this configuration.

Only a single escape character may be configured. The default is the backslash character.

Encryption
Specifies if an encrypted connection is required to access the DSN (yes or no). The default is no.

Qualifier
Specifies the DSN qualifier (aka. catalog name) of the data source. By default, this is the data source name as specified in the section title.

Please note that any non-alphanumeric character is replaced with an underscore, to prevent potential SQL syntax problems, e.g., "SQL/R Example" is replaced with "SQL_R_Example".


In addition to DSN specific config items, most odbc.cfg config items may be re-defined per data source, including:
LogFile, LogFlags, Security, UserFile, PswdFile, Panic, TmpDir, SortOrder, ArraySep, LdapUri, LdapBindDn, LdapBase, LdapUserMatch, LdapFilter, LdapGroupAttr, LdapTimeout, LdapCertsDir.