FreeTDS User Guide: A Guide to Installing, Configuring, and Running FreeTDS
Prev | Chapter 4. Preparing ODBC | Next

# Connection attributes

The following table defines all possible ODBC connection attributes for the FreeTDS ODBC driver. Which ones you'll need depends on how you set yourself up. They may appear in your connection string, or in `odbc.ini`.

Table 4-1. Connection attributes used only in connection strings

Name | Possible Values | Default | Meaning
--- | --- | --- | ---
`DSN` | A valid DSN entry | none | The `DSN` to which FreeTDS should connect. FreeTDS will search `odbc.ini` for entry. It lets you specify a connection as for `SQLConnect`, but using `SQLDriverConnect`. Do not use `Servername` and `DSN` together.
`UID` | Any valid username | none | The username to be used when connecting. To use domain authentication, specify the domain using the format `domain\username`.
`PWD` | Any | empty | The password to be used when connecting.
`WSID` | Any | Computer name | The name of the local computer, sent to server. Can be specified only for a DSN-less connection.

Table 4-2. Connection attributes that may appear in `odbc.ini`

Name | Possible Values | Default | Meaning
--- | --- | --- | ---
`Servername` | A valid `freetds.conf` server section | none | A `freetds.conf` servername, not a hostname as known to DNS. If you want to use ODBC-only configuration, use `Server` instead.
`Server` | A server name or (ip) address | none | Hostname of a server. Used in an ODBC-only configuration. To specify a Microsoft SQL Server instance, use the form `server\instance`.
`Port` | Any TCP port | Depends on the TDS version specified with configure | The TCP port where the dataserver is listening.
`TDS_Version` | Any valid protocol version | Depends on the TDS version specified with configure | TDS protocol version to use (e.g., 5.0, 7.0).
`APP` | Free form text, up to 30 characters. | none | Application name. Identifies the connecting application to the server.
`LANGUAGE` | Any | us_english | (Human) language the server should use for error messages.
`Address` | Any | none | IP address of the dataserver. Useful if you want to specify a server by address, rather than by name. The format is `ip,port` or simply `ip` in standard dotted-decimal notation.
`Database` | Any | none | Specify which database you want to access. If the database does not exist or the user lacks permission to access it, the connection will fail.
`TextSize` | Any | DB dependent | Maximum size returned from server for blobs.
`PacketSize` | Any | DB dependent | Size of packets to server. Some users saw some performance gain by increasing this value. Normally you shouldn't set it.

Prev | Home | Next
Preparing ODBC | Up | DSN-less configuration