I have an script that retrieve data from an Access database (items.mdb). The
script work fine in Windows95, Windows98 but when I run it in WindowsNT (7
diferent computers with WindowsNT) the script didn't run and give me the
same error. I will apreciate any help from all of you. Here are the script
and the error:

#!perl.exe

use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';

print header;

my $database = "items.mdb";
my $table    = "items";
my $field    = "items";
my $DSN      = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=$database;UID=;PWD=;";
my $SQL      = "SELECT $field FROM $table WHERE items = 10";

my $Conn = Win32::OLE->new("ADODB.Connection");
my $RS   = Win32::OLE->new("ADODB.Recordset");

$Conn->Open($DSN);

$RS->Open($SQL, $Conn, 1, 1);

until ($RS->EOF)
{   
   my $value = $RS->Fields($field)->value;
   print "$value<br>";   
   $RS->MoveNext;
}

$RS->Close;
$Conn->Close;


Software error:
Can't call method "value" on an undefined value at
d:\PROGRA~1\ABRIAM~1\apache\cgi-bin\test.pl line 26.
For help, please send mail to the webmaster giving this error message and
the time and date of the error. 


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to