# FreeTDS User Guide

## A Guide to Installing, Configuring, and Running FreeTDS

### Brian Bruns

### James K. Lowden

Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Brian Bruns and James K. Lowden

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.

List of Tables
3-1. Versions of the TDS Protocol, by Product
3-2. `freetds.conf` settings
3-3. Valid bitmask values for `debug flags` entry in `freetds.conf`
4-1. Connection attributes used only in connection strings
4-2. Connection attributes that may appear in `odbc.ini`
5-1. pool.conf settings
11-1. db-lib API Implementation Summary
11-2. ct-lib API Implementation Summary
11-3. ODBC API Implementation Summary
11-4. Kinds of Results
11-5. Result-fetching functions
11-6. Data-fetching functions
11-7. Putting it all together
A-1. Services Line

List of Examples
3-1. A `freetds.conf` file example
3-2. Failing to connect with tsql
3-3. Connect with tsql using a servername in `freetds.conf`
3-4. Connect with tsql using a hostname and port number
3-5. Show compile-time settings with tsql
4-1. Sample files for a DSN-less configuration
4-2. Connecting with a DSN-less configuration
4-3. Connecting with a DSN-less configuration that does not use `freetds.conf`
4-4. Sample ODBC-only `odbc.ini` file
4-5. Sample ODBC-combined `odbc.ini` file
4-6. Sample ODBC-combined `freetds.conf` file
4-7. Compile `odbctest` without a driver manager.
5-1. Emulate Little Endian `freetds.conf` setting
5-2. Configuring for GREEK `freetds.conf` setting
5-3. Configuring for UTF-8 `freetds.conf` setting
5-4. Logging in with a domain login
5-5. Turning on Dump File Append mode in `freetds.conf`
5-6. pool.conf
5-7. Unencrypted entry in `freetds.conf`
5-8. Encrypted entry in `freetds.conf`
7-1. The SQSH Makefile
7-2. Building DBD::Sybase
7-3. Connect to a server with DBD::Sybase
7-4. Building DBD::ODBC
7-5. Connect to a server with DBD::ODBC
7-6. PHP and db-lib for "Sybase"
8-1. Finding the server's host
8-2. Finding the server
8-3. Connecting to the server, bypassing `freetds.conf`
8-4. Connecting to the server using `freetds.conf`
11-1. Building the Sample Code
11-2. Sample Code: `db-lib` header files
11-3. Sample Code: `db-lib` prolog
11-4. Sample Code: `db-lib` Initialize
11-5. Sample Code: `db-lib` Connect to the server
11-6. Sample Code: `db-lib` Send a query
11-7. Sample Code: `db-lib` Fetch Results
11-8. Sample Code: `db-lib` Error and Message handlers
A-1. An `interfaces` file example
B-1. "HELLO" in UCS-2 and UTF-8

|  | Next
|  | About this User Guide