Wednesday, May 23, 2007

UnixODBC on Ubuntu Feisty

Here is what we did on Ubuntu Feisty, to get unixODBC to work and connect to an SQL Server instance.

export ODBCINI=/etc/odbc.ini
export ODBCSYSINI=/etc
sudo apt-get install freetds-dev libdbd-odbc-ruby unixodbc-dev sqsh tdsodbc

After that, following the setup (from the setting of /etc/freetds/freetds.conf) of the wiki page worked like a charm. Or almost: the test with isql did not work too well, as we could not execute any sql statement and kept getting [ISQL]ERROR: Could not SQLPrepare errors... But the test in the interactive Ruby shell did work, and our Rails application can now use SQL Server just fine.

3 comments:

Pablo Viquez said...

try:

select * from [table_name]

dont forget the squares

Yves-Eric said...

Thanks for the tip Pablo. I don't have the setup to try it at the moment but I sure will next time I get the chance.

Anonymous said...

Pablo's tip didn't work... ;(