# Odbc data source name not found

**URL:** <https://www.ruby-forum.com/t/odbc-data-source-name-not-found/149941>\
**Category:** Rails\
**Created:** [October 1, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/odbc-data-source-name-not-found/149941 "2008-10-01T12:27:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![linus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@linus](https://www.ruby-forum.com/u/linus)\
**Post date:** [October 1, 2008, 12:27pm UTC](https://www.ruby-forum.com/t/odbc-data-source-name-not-found/149941/1 "2008-10-01T12:27:30Z")

</div>

Hi,  
I have been trying to get MSSQL working on mac, but it apears that my  
iodbc setup is broken:

tomasz-baks-imac:~ tb$ iodbctest  
“dsn=wcompany\_odbc;uid=thesystem\_test;pwd=thesystem\_test”  
iODBC Demonstration program  
This program shows an interactive SQL processor  
Driver Manager: 03.52.0406.1211  
1: SQLDriverConnect = [iODBC][Driver Manager]Data source name not found  
and no default driver specified. Driver could not be loaded (0)  
SQLSTATE=IM002  
1: ODBC\_Connect = [iODBC][Driver Manager]Data source name not found and  
no default driver specified. Driver could not be loaded (0)  
SQLSTATE=IM002

tomasz-baks-imac:~ tb$ cat /opt/local/etc/odbc.ini  
[wcompany\_odbc]  
Driver = /opt/local/lib/libtdsodbc.so  
Description = ODBC connection via FreeTDS  
Trace = yes  
TraceFile = /tmp/odbc.log  
Servername = wcompany  
TDS\_version = 8.0  
Database = thesystemTest

tomasz-baks-imac:~ tb$ cat /opt/local/etc/odbcinst.ini  
[FreeTDS]  
Description = TDS Driver  
Driver = /opt/local/lib/libtdsodbc.so  
Setup = /opt/local/lib/libtdsS.so  
CPTimeout =  
CPReuse =  
FileUsage = 1

The configure files are like the ones that work on Ubuntu.  
It might be me doing something strange with Mac setup.  
I example when I moved odbc\*.ini files to /etc I got different error  
(I am not sure that that one gets me closer ☹

tomasz-baks-imac:~ tb$ iodbctest  
“dsn=wcompany\_odbc;uid=thesystem\_test;pwd=thesystem\_test”  
iODBC Demonstration program  
This program shows an interactive SQL processor  
Driver Manager: 03.52.0406.1211  
1: SQLDriverConnect = [FreeTDS][SQL Server]Unable to connect: Adaptive  
Server is unavailable or does not exist (20009) SQLSTATE=08S01  
2: SQLDriverConnect = [FreeTDS][SQL Server]Unable to connect to data  
source (0) SQLSTATE=08001  
1: ODBC\_Connect = [FreeTDS][SQL Server]Unable to connect: Adaptive  
Server is unavailable or does not exist (20009) SQLSTATE=08S01  
2: ODBC\_Connect = [FreeTDS][SQL Server]Unable to connect to data source  
(0) SQLSTATE=08001

The file /tmp/odbc.log is not being created. I have no idea what to try  
next.

I have verified that tshl work fine for that database:  
tomasz-baks-imac:th\_b\_rails21 tb$ tsql -H 10.10.1.2 -p 1433 -U  
thesystem\_test -P thesystem\_test  
locale is “C/UTF-8/C/C/C/C”  
locale charset is “”  
1\> use thesystemTest  
2\> go  
1\> select count(\*) from NItems  
2\> go

220  
(1 row affected)  
1\>

Cheers,  
Tomasz
