perlquestion
perlraj
<p>Hi I have a problem with connecting MSSQL Server using FreeTDS<br>I am using Ubuntu 12.04 LTS<br>I have installed unixODBC in the path /usr/local/unixODBC and freeTDS in /usr/local/freeTDS and got all the files like odbc.ini, odbcinst.ini and freetds.conf in the path /etc<br>i am trying to connect with DNS less connection following the instructions from the link</p>
<a href=http://www.freetds.org/userguide/dsnless.htm> www.freetds.org/userguide/dsnless.htm</a>
<p>I am getting the error <code>[unixODBC][FreeTDS][SQL Server] Unable to connect to data source (SQL-08001)</code></p>
<code>
Driver config file odbcinst.ini
[FreeTDS]
Driver=/usr/local/freetds/lib/libtdsodbc.so
Setup=/usr/local/freetds/lib/libtdsodbc.so
Threading=0
FileUsage=1
DontDLClose=1
</code>
<code>
Perl Program
#!/usr/bin/perl
use strict;
use DBI;
$dsn = "dbi:ODBC:DRIVER={FreeTDS};Server=$server;database=$database;";
$dbh = DBI->connect("$dsn","$user","$password") or die "\n$DBI::errstr\n";
</code>