The following options are the most commonly used: | |
-db= | Name of the database (local or remote) to which the DSN is associated |
-dsn-name= | -dsn= | The data source name |
-help | Display syntax and options help for the dsnadd tool |
-l | List existing DSNs |
openmode=<0|1|-1|-4> | -omode=<-0|1|-1|-4> | Specify the default file open mode for files opened with the current connection. The default is 0, or “Normal.” Can be used only with local connections, not remote client connections. For more information on file open modes, see
DSN Open Mode in ODBC Guide. |
-srv-host= | -host= | Server host name |
-srv-port= | -port= | Server port number. The default is 1583. (See also
Changing the Default Communication Ports in Getting Started with PSQL.) |
-translate=< none | auto > | Encoding translation to use for character data. The default is “none,” meaning that no character data is translated between the client and server on the assumption that the client and server use the same operating system encoding. See
Automatic in ODBC Guide. |
The following options are used to create deprecated, legacy-style DSNs: | |
-clntdsn | Create a deprecated, legacy-style Client DSN with the driver description “Pervasive ODBC Client Interface.” Rather than using Client DSNs, new applications or revised 32-bit applications should create a DSN that connects to a named database using
-db=. |
-engdsn | Create a deprecated, legacy-style Engine DSN with the driver description “Pervasive ODBC Engine Interface.” Rather than using Engine DSNs, new applications or revised 32-bit applications should create a DSN that connects to a named database using
-db=. |
-sdsn= | For use with deprecated, legacy-style Client DSNs. Name of an Engine DSN on the PSQL Server. |
The following options are typically used only for application development and testing: | |
-dsn-desc= | -desc= | dsnadd provides a default DNS description in odbc.ini. If you want to override the default description, use this option to specify a descriptive string of your choosing. If the descriptive string contains the space character, you must quote the entire string with double quotes. |
-drv-desc= | dsnadd handles the driver descriptions based on the absence or presence of the -db, -clntdsn and -engdsn options. If specified, must be one of the following: •Pervasive ODBC Interface •Pervasive ODBC Client Interface •Pervasive ODBC Engine Interface |
-drv-path= | -drv= | The path where the driver libraries are located. The default is /usr/local/psql/lib:$HOME/lib. |
-odbc-ini= | -ini= | ODBC.ini file name (for example, /usr/local/psql/etc/odbc.ini) |
ODBC Driver Description in INI Files | Driver Library Installed With | Behavior for All Products Installed With |
Pervasive ODBC Engine Interface | PSQL Server 64-bit PSQL Server 32-bit (Linux only) | •Installation assigns an ODBC driver in odbc.ini for compatibility with preexisting Engine DSNs •Connects to a local named database •No longer created by default with dsnadd (the
-engdsn option must be specified) •Visible when viewing Engine DSNs” in ODBC Administrator running on a Windows client •For use by 32-bit applications that are already coded to use Engine DSNs •32-bit Engine DSNs are deprecated on Linux. |
Pervasive ODBC Client Interface | PSQL Server 64-bit PSQL Server 32-bit (Linux only) PSQL Client 32-bit (Linux only) | •Installation assigns an ODBC driver in odbc.ini for compatibility with preexisting Client DSNs •Connects to a local or remote named database or an Engine DSN •For use only by 32-bit applications that are already coded to use Client DSNs •No longer created by default when -host is specified with dsnadd (the
-clntdsn option must be specified) •32-bit Client DSNs are deprecated on Linux. |
Pervasive ODBC Interface | PSQL Server 64-bit PSQL Client 64-bit | •Installation assigns ODBC drivers in odbcinst.ini for use by new 32-bit and 64-bit DSNs •Connects to a local or remote named database •The recommended driver description to use for 32-bit and 64-bit applications •Created by default with dsnadd •Not visible as Engine DSNs” in ODBC Administrator running on a Windows client. |
Question | Answer |
What do I need to do about DSNs if I port my 32-bit application to 64-bit? | If the application uses DSN-less connections that connect using “Pervasive ODBC Client Interface,” change the ODBC driver description to Pervasive ODBC Interface.” If the application uses DSNs, you must create new DSNs that connect to a named database. |
What is a DSN-less connection? | A DSN-less connection is one that connects to a named database using the ODBC driver “Pervasive ODBC Client Interface” (for preexisting 32-bit applications) or the “Pervasive ODBC Interface” driver (for 32-bit or 64-bit applications). |
Can I still create deprecated, legacy-style Engine DSNs and Client DSNs? | |
If I am using ODBC Administrator on a Windows client, why do I not see my DSNs? | On 64-bit Windows operating systems, 64-bit system DSNs are distinct from 32-bit system DSNs because of the registry design. If you are using the 64-bit ODBC Administrator, you will not see the 32-bit system DSNs, and vice versa. |
What if my application uses DTI to manage DSNs? | The DTI functions for DSNs manage only 32-bit Engine DSNs. Therefore, the DTI functions for DSNs are deprecated along with the 32-bit Engine Interface ODBC driver. An alternative to using DTI to manage DSNs is to use SQL and ODBC statements. For example, you could use
CREATE DATABASE to create a named database and SQLConfigDatasource to configure the DSNs. |
Going forward, is there a recommended strategy for ODBC connections? | Yes. New applications or revised 32-bit applications, local or remote, should connect to a named database. |