If your application requires a connection string to connect to a data source, you must specify the data source name that tells the ODBC driver the ODBC data source section to use for the default connection information. Optionally, you can specify attribute=value pairs in the connection string to override the ODBC data source default values. The override values are not written to the ODBC data source file.
You can specify either long or short names in the connection string. The connection string has the following form:
DSN=data_source_name{;attribute=value [;attribute=value];...}
An example of a DirectConnect connection string is as follows:
DSN=SYBDC TABLES; SRVR=QESRVR;DB=PAYROLL;UID=JOHN;PWD=XYZZY
Long and short names for each attribute are shown in the following table.
Attribute long name |
Short name |
---|---|
DataSourceName |
DSN |
ServerName |
SRVR |
LoginID |
UID |
Password |
PWD |
Database |
DB |
Language |
LANG |
Charset |
CS |
HostName |
HOST |
ApplicationName |
APP |
InterfacesFile |
IFILE |
ArraySize |
AS |
YieldProc |
YLD |
InitializationString |
IS |
ModifySQLStatement |
MSS |