Skip to Content.
Sympa Menu

freetds - Troubles connecting to an MSSQL 2000

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ruben Vandille <ruben AT dedigate.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Troubles connecting to an MSSQL 2000
  • Date: 13 Jun 2001 22:20:24 +0200


Hi guys,

I installed freetds on a linux box and compiled sqsh with
$SYBASE="/usr/local/freetds".
There were no compiling problems, but when I try to connect to an
MSSQL2000-server (after I edited the interfaces file), I can't get to
the sqsh prompt ... the program quits immediately.
If I try the perl-approach, I have the same problem: It quits without an
error message. (Perl stopped at this line: [die "Unable to connect to
server: $DBI::errstr" unless $dbh;])
When I do a tcpdump, I see the server actually talking to each other.

Is there anyone who had similar problems, that can give me a some advice
on how to fix/debug this problem?

Thanks in advance,

Ruben

-> I attached all output of my attempts below...

+++++
*The tests:

[root@mrtg101 /root]# ./odbc-test
Unable to connect to server: at ./odbc-test line 16.
[root@mrtg101 /root]# ./sqsh -S monitor102 -U em-be
sqsh-1.7 Copyright (C) 1995-1999 Scott C. Gray
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Password:
[root@mrtg101 /root]#



*The output of tcpdump:

[root@mrtg101 /root]# tcpdump -fln not port 22 | grep "10.10.240.6"
Kernel filter, protocol ALL, datagram packet socket
tcpdump: listening on all devices
22:19:41.144674 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: S
2734759441:2734759441(0) win 32120 <mss 1460,sackOK,timestamp 470675260
0,nop,wscale 0> (DF)
22:19:41.144886 eth0 < 10.10.240.6.1433 > 10.10.240.21.1327: S
899050124:899050124(0) ack 2734759442 win 17520 <mss 1460,nop,wscale
0,nop,nop,timestamp 0 0,nop,nop,sackOK> (DF)
22:19:41.144911 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: . 1:1(0)
ack 1 win 32120 <nop,nop,timestamp 470675260 0> (DF)
22:19:41.145309 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: P
1:513(512) ack 1 win 32120 <nop,nop,timestamp 470675260 0> (DF)
22:19:41.267513 eth0 < 10.10.240.6.1433 > 10.10.240.21.1327: . 1:1(0)
ack 513 win 17008 <nop,nop,timestamp 13137513 470675260> (DF)
22:19:41.267527 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: P
513:606(93) ack 1 win 32120 <nop,nop,timestamp 470675272 13137513> (DF)
22:19:41.269483 eth0 < 10.10.240.6.1433 > 10.10.240.21.1327: F 1:1(0)
ack 606 win 16915 <nop,nop,timestamp 13137513 470675272> (DF)
22:19:41.269495 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: .
606:606(0) ack 2 win 32120 <nop,nop,timestamp 470675272 13137513> (DF)
22:19:41.269692 eth0 > 10.10.240.21.1327 > 10.10.240.6.1433: F
606:606(0) ack 2 win 32120 <nop,nop,timestamp 470675272 13137513> (DF)
22:19:41.269822 eth0 < 10.10.240.6.1433 > 10.10.240.21.1327: . 2:2(0)
ack 607 win 16915 <nop,nop,timestamp 13137513 470675272> (DF)


*The interfaces file:

monitor102
query tcp eth0 10.10.240.6 1433
master tcp eth0 10.10.240.6 1433


*The perl script:

#!/usr/bin/perl -w
#

$ENV{'SYBASE'} = "/usr/local/freetds";
#$ENV{'DSQUERY'} = "monitor102";

my $server = "monitor102";
my $database = "netsaint";
my $username = "em-be";
my $password = "k9b17l";

use DBI;

my $dbh = DBI->connect("dbi:Sybase:server=$server;database=$database",
$username, $password, {PrintError => 0});

die "Unable to connect to server: $DBI::errstr"
unless $dbh;

my $rc;
my $sth;

$sth = $dbh->prepare("select \@\@servername");
if($sth->execute) {
while(@dat = $sth->fetchrow) {
print "@dat\n";
}
}
+++++





Archive powered by MHonArc 2.6.24.

Top of Page