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`, as indicated in the final column.

Table 4-1. Connection attributes

Name | Meaning | Possible Values | Default | In `odbc.ini`
--- | --- | --- | --- | ---
`DSN` | Use DSN. FreeTDS will search `odbc.ini` for entry. It lets you specify a connection like `SQLConnect`, but using `SQLDriverConnect`. Do not use `Servername` and `DSN` together. Can be specified only in a connection string, not in `odbc.ini`. | A valid DSN entry | none | no
`Servername` | A `freetds.conf` servername, not a hostname as known to DNS. If you want to use ODBC-only configuration, use `Server` instead. | A valid `freetds.conf` server section | none | yes
`Server` | Hostname of a server. Used in an ODBC-only configuration. As of version 0.64 you can specify a Microsoft SQL Server instance in the form of `server\instance`. This isn't required to connect to an instance, and is in fact slightly slower to set up the conncection, because it entails an extra round trip to the server. To avoid that, ask to your administrator for the port number of each instance, and create separate server entries for each one. | A server name or (ip) address | none | yes
`Port` | The TCP port where the dataserver is listening. | Any TCP port | Depends on the TDS version specified with configure | yes
`UID` | Can be specified only for a DSN-less connection. (For security reasons, do not store username/password in a configuration file). To use domain authentication, specify the domain using the format `domain\password`. | Any valid username | none | no
`PWD` | Can be specified only for a DSN-less connection. (For security reasons, do not store username/password in a configuration file). Clear text password (use domain password for domain authentication). | Any | empty | no
`TDS_Version` | TDS protocol version to use (e.g., 5.0, 7.0). | Any valid protocol version | Depends on the TDS version specified with configure | yes
`APP` | Application name. Identifies the connecting application to the server. | Free form text, up to 30 characters. | none | yes
`WSID` | Name of the local computer, sent to server. Can be specified only for a DSN-less connection. | Any | Computer name | no
`LANGUAGE` | (Human) language the server should use for error messages. | Any | us_english | yes
`Address` | 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. | Any | none | yes
`Database` | Specify which database you want to access. If database do not exists or you haven't permission to access it, the connection will fail. | Any | none | yes
`TextSize` | Maximum size returned from server for blobs. | Any | DB dependent | yes
`PacketSize` | Size of packets to server. Some users saw some performance gain by increasing this value. Normally you shouldn't set it. | Any | DB dependent | yes

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