Attach CLI/ODBC configuration keyword
Specifies whether to attach to the server instance. You can specify this keyword in the connection string or set it in the db2cli.ini or db2dsdriver.cfg file.
- db2cli.ini keyword syntax:
- ATTACH = TRUE | FALSE
- Default setting:
- The SQLDriverConnect() function connects to the specified database.
- Equivalent environment or connection attribute:
- N/A
- Usage notes:
When you set the keyword to TRUE, the SQLDriverConnect() function does not connect to a database but instead connects to the specified server instance.
To establish a connection with a Db2® server instance for remote server, the CLI application must specify values for the Hostname, Port, UID, PWD, and Protocol along with setting the keyword to TRUE.
Any value other than TRUE that you assign to the ATTACH keyword is treated as FALSE.
- Examples:
- The following example shows a specification of the keyword in the db2cli.ini file:
- The following example shows specifications of the keyword in the db2dsdriver.cfg file:
Version information
- Last update
- This topic was last updated for IBM® Db2 Version 9.7, Fix Pack 3.
- IBM Data Server Client
- Supported in Db2