[freetds] DBD::Sybase connect problems

Khurt Williams khurtwilliams at gmail.com
Wed Mar 16 16:06:21 EST 2005


I downloaded and compiled FreeTDS to access a SQL Server 2000 database
from Red Hat Enterprise Linux ES release 3.

I compiled with the following options:
-bash-2.05b$ tsql -C
locale is "en_US"
locale charset is "ISO-8859-1"
Compile-time settings (established with the "configure" script):
                           Version: freetds v0.62.4
    MS db-lib source compatibility: no
       Sybase binary compatibility: unknown
                     Thread safety: no
                     iconv library: yes
                       TDS version: 8.0
                             iODBC: no
                          unixodbc: no
I can conntect to the SQL Server with the tsql utility and execute queries.

-bash-2.05b$ tsql -U testuser -S REMOTEDB
locale is "en_US"
locale charset is "ISO-8859-1"
Password:
Msg 5703, Level 0, State 1, Server REMOTEDB, Line 0
Changed language setting to us_english.

However whenever I connect to the database from Perl using the
DBD::Sybase (1.05) I get the following error.

-bash-2.05b$ ./db.pl
cs_config(CS_LOC_PROP) failed at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.

My db.pl scripts is as follows.

#!/usr/bin/env perl
use strict;
use diagnostics;
use DBI;

BEGIN {
    $ENV{SYBASE} = '/utils/freetds';
    $ENV{DSQUERY} = 'REMOTEDB';
}

my $user   = 'testuser';
my $passwd = 'testpassword';

my $dbh =
  eval { DBI->connect( 'dbi:Sybase:', $user, $passwd ); }
  or die($!);

$dbh->disconnect();

The script never makes it pass the connect statement.

My freetds conf look like this.

# A typical Microsoft SQL Server 2000 configuration
[REMOTEDB]
;       host = 192.168.1.15
        host = remotedb.mydomain.com
        port = 1433
        tds version = 7.0

Can someone point me in the right direction?

--
Sincerely,
Khurt Williams, MSE, CISSP




-- 
Sincerely,
Khurt Williams, MSE, CISSP



More information about the FreeTDS mailing list