[freetds] [comp.lang.perl.misc] Re: DBD::Sybase, FreeTDS problem

Michael Peppler mpeppler at peppler.org
Thu Jun 24 02:48:55 EDT 2004


FYI - DBD::Sybase 1.03 and later understand host= and port= attributes in
the DSN, but this triggers the use of the CS_SERVERADDR connection
property, a new feature of OpenClient 12.5.1.

If host/port are used and the library doesn't know about CS_SERVERADDR a
fatal error is generated.

Michael

On Thu, 24 Jun 2004 08:12:41 +0200, Michael Peppler wrote:

> On Wed, 23 Jun 2004 14:15:34 -0700, Daniel Berger wrote:
> 
>> Hi all,
>> 
>> Perl 5.8.2
>> Solaris 9
>> FreeTDS 0.63 (20040622)
>> DBI 1.42
>> DBD::Sybase 1.04
>> 
>> I installed FreeTDS 0.63 successfully.  I can definitely connect using
>> tsql.  However, when I try this simple script I get an error.
>> 
>> use strict;
>> use warnings;
>> use DBI;
>> use DBD::Sybase;
>> 
>> my $login  = "user";
>> my $passwd = "xxxx";
>> my $server = "SOME-SERVER";
>> my $host   = "somehost";
>> my $port   = 1030;
>> 
>> $ENV{SYBASE} = "/usr/local";
>> my $dbh =
>> DBI->connect("dbi:Sybase:server=$server;host=$host;port=$port",$login,
>> $passwd);
>> 
>> $dbh->disconnect();
>> 
>> The error is: This version of OpenClient doesn't support CS_SERVERADDR
>> at /opt/csw/lib/perl/site_perl/DBD/Sybase.pm line 87.
> 
> DBD::Sybase doesn't use the host/port method of connecting to a database
> server. Instead it uses a logical server name defined in the interfaces
> file (or in the freetds.conf file.)
> 
> The only exception is when using Sybase OpenClient 12.5.1 or later, where
> the API has the ability to by-pass the interfaces file.
> 
> If "SOME-SERVER" is defined in your freetds.conf file you can simply
> remove the host/port info from the DSN and it should work correctly.
> 
> Michael

-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler at peppler.org                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.peppler.org/resume.html




More information about the FreeTDS mailing list