Hello,
I am trying to use Perl to connect to an MSSQL Server 7 running on NT 4 from
a Linux box (2.2.16). The Linux box is running Perl 5.005_03.
I installed the FreeTDS libraries some time ago and happily use them to
connect to the same MSSQL server using PHP 4.0.6. From what I have been able
to gather so far, the Perl DBD::Sybase functionality ought to work with
MSSQL servers too.
I installed DBI using CPAN ('Install Bundle::DBI') which appeared to be
successful.
I installed DBD::Sybase using CPAN, which failed. So then I tried building
and installing DBD::Sybase from the shell instead of within CPAN.
In the DBD-Sybase source directory, I edited the CONFIG file to point SYBASE
to our installed libraries (using FreeTDS 0.52) and added EXTRA_LIBS=-linsck
as suggested by the comments. (This is DBD-Sybase-0.91, as recommended for
use with DBI.)
Although I get warnings for 'make Makefile.PL' ...
Note (probably harmless): No library found for -lcs
Note (probably harmless): No library found for -lsybtcl
Note (probably harmless): No library found for -lcomn
Note (probably harmless): No library found for -lintl
... the make succeeds. Running 'make test' results in an error:
t/autocommit........connect: Network is unreachable
Can't call method "do" on an undefined value at t/autocommit.t line 45.
dubious
Test returned status 255 (wstat 65280, 0xff00)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/5.00503/Test/Harness.pm line 288.
make: *** [test_dynamic] Error 255
I have tried installing DBD::Sybase anyway. I then used a script to test
whether DBD::Sybase was available (it was). But I am not able to make a
connection. Here's the script (taken from Programming the Perl DBI).
#!/usr/bin/perl -w
#
# ch04/listdsns: Enumerates all data sources and all installed drivers
#
use DBI;
### Probe DBI for the installed drivers
my @drivers = DBI->available_drivers();
die "No drivers found!\n" unless @drivers; # should never happen
### Iterate through the drivers and list the data sources for each one
foreach my $driver ( @drivers ) {
print "Driver: $driver\n";
my @dataSources = DBI->data_sources( $driver );
foreach my $dataSource ( @dataSources ) {
print "\tData Source is $dataSource\n";
}
print "\n";
}
exit;
That outputs several available drivers like so:
Driver: ExampleP
Data Source is dbi:ExampleP:dir=.
Driver: Multiplex
Driver: Proxy
Driver: Sybase
So can anyone tell me where I am going wrong?
Thanks in advance,
David B.
--
David Buxton - planetrapido.com
Email [EMAIL PROTECTED] 14 - 16 Great Pulteney St.
Tel 020-7440-5760 London, W1F 9ND
Mobile 07967-484643 United Kingdom