<?xml version="1.0" encoding="windows-1252"?>
<node id="1008467" title="[unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQL-08001)" created="2012-12-12 03:04:07" updated="2012-12-12 03:04:07">
<type id="115">
perlquestion</type>
<author id="993957">
perlraj</author>
<data>
<field name="doctext">
&lt;p&gt;Hi I have a problem with connecting MSSQL Server using FreeTDS&lt;br&gt;I am using Ubuntu 12.04 LTS&lt;br&gt;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&lt;br&gt;i am trying to connect with DNS less connection following the instructions from the link&lt;/p&gt;

&lt;a href=http://www.freetds.org/userguide/dsnless.htm&gt; www.freetds.org/userguide/dsnless.htm&lt;/a&gt;

&lt;p&gt;I am getting the error &lt;code&gt;[unixODBC][FreeTDS][SQL Server] Unable to connect to data source (SQL-08001)&lt;/code&gt;&lt;/p&gt;

&lt;code&gt;
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
&lt;/code&gt;

&lt;code&gt;
Perl Program
#!/usr/bin/perl
use strict;
use DBI;

$dsn = "dbi:ODBC:DRIVER={FreeTDS};Server=$server;database=$database;";
$dbh = DBI-&gt;connect("$dsn","$user","$password") or die "\n$DBI::errstr\n";
&lt;/code&gt;
</field>
</data>
</node>
