S
Saya
Hi all,
I have run into a problem with DBI connection to MS SQL server. I have
a script within which the below is executed:
my $DSN = 'driver={SQL
Server};Server=servername;database=dbname;Network=DBMSSOCN';
my $dbh = DBI->connect("DBI:ODBC:$DSN",'dbuser', 'dbpass') or die
$DBI::errstr;
my $sth = $dbh->prepare("Select categoryName, categoryID from
tblCategory Order By categoryName");
$sth->execute;
Now this script works on server1 and server2, but when I copy this
script to NewServer I get the following error:
DBI connect('driver={SQL Server};Server=servername,
1304;database=dbname;Network=
DBMSSOCN','dbname',...) failed: [Microsoft][ODBC SQL Server Driver]
[TCP/IP Sock
ets]General network error. Check your network documentation.
(SQL-08001)
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(Connect()). (
SQL-01000)(DBD: db_login/SQLConnect err=-1) at E:\custom\perl
\Category.ipl line 16
Can't call method "prepare" on an undefined value at E:\custom\perl
\Category.ipl line 18.
I can ping servername (the sql server) from the NewServer. The DBI
version on all the servers is the same (1.38). Also the perl version
is the same (v5.8.2 built for MSWin32-x86-multi).
Does anyone have any hints/clues as what might be going wrong here.
Any help will be greatly appreciated.
regards
Saya
I have run into a problem with DBI connection to MS SQL server. I have
a script within which the below is executed:
my $DSN = 'driver={SQL
Server};Server=servername;database=dbname;Network=DBMSSOCN';
my $dbh = DBI->connect("DBI:ODBC:$DSN",'dbuser', 'dbpass') or die
$DBI::errstr;
my $sth = $dbh->prepare("Select categoryName, categoryID from
tblCategory Order By categoryName");
$sth->execute;
Now this script works on server1 and server2, but when I copy this
script to NewServer I get the following error:
DBI connect('driver={SQL Server};Server=servername,
1304;database=dbname;Network=
DBMSSOCN','dbname',...) failed: [Microsoft][ODBC SQL Server Driver]
[TCP/IP Sock
ets]General network error. Check your network documentation.
(SQL-08001)
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(Connect()). (
SQL-01000)(DBD: db_login/SQLConnect err=-1) at E:\custom\perl
\Category.ipl line 16
Can't call method "prepare" on an undefined value at E:\custom\perl
\Category.ipl line 18.
I can ping servername (the sql server) from the NewServer. The DBI
version on all the servers is the same (1.38). Also the perl version
is the same (v5.8.2 built for MSWin32-x86-multi).
Does anyone have any hints/clues as what might be going wrong here.
Any help will be greatly appreciated.
regards
Saya