Recently I had to connect to a Microsoft SQL server … I have to say that I’m not a big Windows fan, in fact I’m not at all :), so I had to look for a workaround in order to not connect via Microsoft SQL Server Studio Express. I google it for a while and in the end I’ve found iODBC. This information applies to you if you are within Ubuntu and trying to connect to any type of Microsoft SQL (MSSQL) Server. To install it go into Synaptic Package Manager and search for this packages: iodbc, libiodbc2, libct3, tdsodbc and unixodbc. Or you can install these packages from command line using “apt-get install package“. The executable is located: /usr/bin/iodbcadm-gtk. After that go to home directory into terminal and edit .iodbc.ini file.

Contents of <.iodbc.ini>

[ODBC Data Sources]
ODBCdsn = ODBC Server
Driver      = /usr/lib/odbc/
Description = ODBC Server
Trace       = No
Servername  = ODBC
Database    =         [name of your database]
Driver = /usr/lib/odbc/
We now need to setup the FreeTDS driver which does the translation for communications purposes to MSSQL.[pensacola@pensacola-tech ~]#gedit /etc/freetds/freetds.conf

Contents of <freetds.conf>

host =   [IP address of your database server]
port = 1433                      [Port of your database server]
tds version = 8.0              [Google:  FreeTDS if you are on a different version of MSSQL]

Startup the iODBC  we installed above.  Goto the User DSN tab.  Click test and authenticate with a valid username and password.

So there it is!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>