here's the error message:
Can't call method "Fields" on unblessed reference
I'm using ASP-Perl and taking a value from a form
to execute a query against an SQL database.
my $SQLstring = "SELECT * FROM table WHERE field1='";
my $filter = $Request->Form('USERFIELD')->$Item();
# this is taken directly out of the pages of
# the O'Reilly Book CGI Programming.
# I try to "clean up" the data that was entered
# by the user and then take that
# 'untainted data' out of a system variable
#
# the program dosen't work with or without this statement
$filter=~ /^([\w.])$/;
$filter = $1;
$SQLstring .= $filter
my $Provider = "SQLOLEDB";
my $ConnectString = "driver={SQL Server};server=SRVR;database=DB";
my $Conn = $Server->CreateObject("ADODB.Connection");
$Conn->Open($ConnectString);
my $RS = $Conn->Execute( "$SQLstring" );
# this is the line on which the error occurs
while ( ! $RS->{EOF} ) {
$Response->Write($RS->Fields(0)->{Value});
$RS->MoveNext;
}
$RS->close;
This whole thing is intended to happen within a subroutine.
If i'm going to run into troubles passing ADODB Recordsets
around, please lemme know. I'm figuring that they're references to objects and shouldn't matter but it might.