Win32::ODBC problem

Posted by solaris2 on 2007-01-11 15:53

Server:
SQL Server 7.0 SP4 running on NT 4.0 SP6

Client:
Windows XP Pro SP2
ActivePerl v5.8.8.819

I'm just trying to execute a very simple SQL statement from Perl (see code below). There is a System DSN named "Logging" which points to the server and database that I want to use. when the first ODBC call is made, i get the error

Could not open ODBC connection because of [Bad file descriptor] at test.pl line x.

What am i doing wrong?

Thanks
Brian

use Win32::ODBC;
$DSN = "Logging";
$db = new Win32::ODBC($DSN);
if (!$db)
{
die "Could not open ODBC connection because of [$!]";
}
$SQL = "update Test set String = \"xxx\" where ID = 2";
$db->sql($SQL);
$db->close();