Here follows a huge copy-paste of my FreeTDS/iodbc/SQLServer notes:
Get yourself the latest build of FreeTDS (0.63 as of writing this),
and build it like so:
tar zxvf freetds-stable.tgz
At this point, we need to hack the generated libtool. Somewhere around
line 205 you should see:
archive_cmds="$CC $(if test .$module = .yes; then echo -bundle;
else echo -dynamiclib; fi) $allow_undefined_flag -o $lib $libobjs
$deplibs $linkopts -install_name $rpath/$soname $verstring"
Basically you need to remove the $deplibs in that line.
sudo make install
You can now test this by trying to connect to an MS SQL Server. To do
this, we’re using the tsql tool that is compiled along with FreeTDS:
$ tsql -H 10.9.0.95 -p 1147 -U sa
locale is “C”
locale charset is “US-ASCII”
1> use northwind
1> select count (*) as “Num” from customers
created by James A.
Firstly, add the driver under the “Drivers” tab.
Then you almost certainly want to create a User DSN, with the parameters
* Server e.g. localhost
* Database e.g. Northwind
* UID e.g. Administrator
* Port e.g. 1147
This data gets stored in ~/Library/ODBC/odbc.ini. Any problems, you
can hack at that.
An entry should look like this:
Driver = /opt/local/lib/libtdsodbc.so
Description = Redcats Development Database
Server = 10.9.0.95
Host = localhost\TESTSQL2
Port = 1147
Database = redcats_dev
TDS_Version = 8.0
I’m not sure if you need to keep the ~/.freetds.conf in sync or not,
but i tend to. You need an entry to correspond with each ODBC entry:
tds version = 8.0
host = GBLON1SQM27
port = 1147
… might be useful.