If your application requires a connection string to connect to a data source, you must specify the data source name. Optionally, you can specify attribute=value pairs to override certain data source and vnode definitions. The ODBC function SQLDriverConnect() or SQLDriverConnectW() is required for connection strings.
The connection string has the form:
DSN=data_source_name[;attribute=value[;attribute=value]...]
Alternatively, you can bypass data source definitions entirely if you include sufficient information in the connection string. The minimum attributes in this case are the SERVER, SERVERTYPE, and DATABASE attribute/value pairs.
DSN-less connection strings have the form:
CONNECTSTR=SERVER=server_name; SERVERTYPE=server_type; DATABASE=database;[attribute=value]…]
The following table provides the keyword for each connection string attribute.
Keyword |
Attribute Value Description |
---|---|
DSN |
Data source name. |
DRIVER |
Driver description as returned by SQLDrivers(). |
UID |
User ID to override vnode definition. If specified, PWD must also be specified. |
PWD |
Password to override vnode definition. If specified, UID must also be specified. |
SERVER |
Vnode name. |
SERVERTYPE |
Server type (for example, INGRES, IDMS, or DB2). |
DATABASE |
Database name as defined on the server. |
DB |
A synonym for DATABASE. |
ROLENAME |
Role name to override vnode definition. |
ROLEPWD |
Role password to override vnode definition. |
GROUP |
Group identifier for the session. Equivalent to the -G flag of the Ingres command-line flags. |
BLANKDATE |
=NULL |
DATE1582 |
=NULL |
DATE |
Same as DATE1582 keyword. |
SELECTLOOPS |
=N |
CATCONNECT |
=Y |
NUMERIC_ OVERFLOW |
=IGNORE |
CATSCHEMANULL |
=Y |