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

NamePossible ValuesDefaultMeaning
DSNA valid DSN entrynoneThe 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.
UIDAny valid usernamenoneThe username to be used when connecting. To use domain authentication, specify the domain using the format domain\username.
PWDAnyemptyThe password to be used when connecting.
WSIDAnyComputer nameThe 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

NamePossible ValuesDefaultMeaning
ServernameA valid freetds.conf server sectionnoneA freetds.conf servername, not a hostname as known to DNS. If you want to use ODBC-only configuration, use Server instead.
ServerA server name or (ip) addressnoneHostname of a server. Used in an ODBC-only configuration. To specify a Microsoft SQL Server instance, use the form server\instance.
PortAny TCP portDepends on the TDS version specified with configureThe TCP port where the dataserver is listening.
TDS_VersionAny valid protocol versionDepends on the TDS version specified with configureTDS protocol version to use (e.g., 5.0, 7.0).
APPFree form text, up to 30 characters. noneApplication name. Identifies the connecting application to the server.
LANGUAGEAnyus_english(Human) language the server should use for error messages.
AddressAnynoneIP 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.
DatabaseAnynoneSpecify which database you want to access. If the database does not exist or the user lacks permission to access it, the connection will fail.
TextSizeAnyDB dependentMaximum size returned from server for blobs.
PacketSizeAnyDB dependentSize of packets to server. Some users saw some performance gain by increasing this value. Normally you shouldn't set it.