Hi,
I'm working with ActivePerl and I need to use the SQL Server Database.
I'm using the DBI module and the database connection is ODBC mode.
I'm working with Web pages and I have problems running a program in
the browser.
The program is the following:
Contest.pl
#--------------------------------------------------------------------#
#!/usr/bin/perl -w -I C:\Inetpub\
use DBI;
use Data:
umper;
&DrawPage();
#--------------------------------------------------------------------#
sub DrawPage() {
my $sBuffer;
$sBuffer = <<__HTML;
<html>
<body>
__HTML
my $moDB;
my $sDSN = "driver={SQL Server};server=B52;database=EIS;
UserID=sa;pwd=''";
my $sConn = "dbi:ODBC:$sDSN";
$moDB = DBI->connect($sConn);
if($moDB){
print "Conected !!!!!!!!!!!\n";
my $sSQL = "select * from entity";
my @aArray = $moDB->selectall_arrayref($sSQL);
print &Dumper(@aArray);
}else{
print "No conected !!!!!!!!!!";
}
$moDB->disconnect || die $moDB->errstr;
$sBuffer = <<__HTML;
</body>
</html>
__HTML
} # end of DrawPage
If I run this program in DOS environment: It's works!... but when I run
this program under the browser, the following error message is sended:
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
DBI->connect(driver={SQL Server};server=B52;database=EIS;UserID=sa;pwd='')
failed: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
(SQL-S1090)(DBD: db_login/SQLConnect err=-1) at C:\Inetpub\\cgi-bin\eis\bin\contest.pl line 22
Can't call method "disconnect" on an undefined value at C:\Inetpub\\EISDemo\cgi-bin\eis\bin\contest.pl line 37.
No conected !!!!!!!!!!
Please, Could somebody help me?
Thanks!
I'm working with ActivePerl and I need to use the SQL Server Database.
I'm using the DBI module and the database connection is ODBC mode.
I'm working with Web pages and I have problems running a program in
the browser.
The program is the following:
Contest.pl
#--------------------------------------------------------------------#
#!/usr/bin/perl -w -I C:\Inetpub\
use DBI;
use Data:
&DrawPage();
#--------------------------------------------------------------------#
sub DrawPage() {
my $sBuffer;
$sBuffer = <<__HTML;
<html>
<body>
__HTML
my $moDB;
my $sDSN = "driver={SQL Server};server=B52;database=EIS;
UserID=sa;pwd=''";
my $sConn = "dbi:ODBC:$sDSN";
$moDB = DBI->connect($sConn);
if($moDB){
print "Conected !!!!!!!!!!!\n";
my $sSQL = "select * from entity";
my @aArray = $moDB->selectall_arrayref($sSQL);
print &Dumper(@aArray);
}else{
print "No conected !!!!!!!!!!";
}
$moDB->disconnect || die $moDB->errstr;
$sBuffer = <<__HTML;
</body>
</html>
__HTML
} # end of DrawPage
If I run this program in DOS environment: It's works!... but when I run
this program under the browser, the following error message is sended:
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
DBI->connect(driver={SQL Server};server=B52;database=EIS;UserID=sa;pwd='')
failed: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
(SQL-S1090)(DBD: db_login/SQLConnect err=-1) at C:\Inetpub\\cgi-bin\eis\bin\contest.pl line 22
Can't call method "disconnect" on an undefined value at C:\Inetpub\\EISDemo\cgi-bin\eis\bin\contest.pl line 37.
No conected !!!!!!!!!!
Please, Could somebody help me?
Thanks!