perl & MSSQL

Andrew Khlebutin andrey at hm.perm.ru
Wed Aug 6 04:39:52 PDT 2003


Hi,

I  need to get an access to MSSQL 2000 SP3 from my perl script. I have
freetds-0.61_1,  p5-DBD-Sybase-1.00,  p5-DBI-1.37  installed  from the
ports. I try to connect this way:
#!/usr/bin/perl
use DBI;
use DBD::Sybase;
...
$dbh_mssql = DBI->connect("dbi:Sybase:server=10.0.0.103:database=$dbname",$msuser,$mspasswd);

it gives this error message:
src/tds/login.c: tds_connect: 10.0.0.103:0: Can't assign requested address
DBI connect('server=10.0.0.103:database=lan','stat',...) failed:  at ./stat.pl line 56

I  can't  understand  at  all why it tries to connect to 10.0.0.103 to
zero  port(0)?I  couldn't find out how to tell the function to connect
to my particular port number. Do you have any comments?

=========================cat freetds.debug===========================
Starting log file with debug level 99.
2003-08-06 12:52:35.050644 iconv will convert client-side data to the "" character set
2003-08-06 12:52:35.050806 iconv_open: cannot convert to ""
2003-08-06 12:52:35.050853 Connecting addr 10.0.0.103 port 0 with TDS version 7.0
2003-08-06 12:52:35.051566 inside ct_con_props() action = CS_GET property = 13
2003-08-06 12:52:35.051631 fetching userdata 137271312
2003-08-06 12:52:35.051824 leaving ct_connect() returning 0
2003-08-06 12:52:35.051860 inside ct_con_drop()
=========================cat freetds.debug===========================

In  the /usr/local/etc/freetds.conf I tried to pinpoint to port number
1433 and server=MSSQL2000 but it doesn't work anyway
[MSSQL2000]
        host = 10.0.0.103
        port = 1433
        tds version = 7.0

In  the  /usr/local/etc/freetds/interfaces  I  also  tried to set port
number with no result too:
...
MSSQL2000
    query tcp 7.0 10.0.0.103 1433

P.S: FreeBSD 4.8 Stable
        
-- 
Andrew Khlebutin



More information about the freebsd-questions mailing list