You need the unixodbc and unixodbc-devel paket from SuSE.
# installing FreeTDS
$ wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
$ tar xvfz freetds-stable.tgz
$ cd freetds-$version/
$ ./configure --with-unixodbc=/usr
$ make
$ sudo make install
# configuration of FreeTDS
$ sudo vim /usr/local/etc/freetds.conf
---schnippp---
# A typical Microsoft SQL Server 2000 configuration [hostdescription-mssql] host = full.qualified.domain.name.tld port = 1433 tds version = 8.0---schnapp---
# configuration of unixODBC
$ sudo vim /etc/unixODBC/odbc.ini
---schnipp---
[system_dsn_name] Driver = /usr/local/lib/libtdsodbc.so Description = my description of this service Trace = 1 Servername = hostdescription-mssql Database = eventlogs---schnapp---
# Tests. Both have to work!
$ isql -v system_dsn_name user_name pass_word
$ tsql -Shostdescription-mssql -Uuser_name
I found the following Script somewhere to connect to the database with perl to get a more verbose erroroutput on failures.
---schnipp---
#!/usr/bin/perl -w
# This Script needs the perl-DBI and perl-DBD-ODBC Package
use strict;
use warnings;
use DBI;
# Configuration
my $user = "my_username";
my $password = "my_password";
my $dbh = DBI-> connect('dbi:ODBC:EVENTLOG', $user, $password, {PrintError => 0,
RaiseError =>0});
if (!$dbh) {
print "I will print all the errorshit!";
print "$DBI::err\n$DBI::errstr\n$DBI::state";
} else {
$dbh->disconnect if ($dbh);
}
---schnapp---