Buckaroo Buddha has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I go about Blessing an Object?
by tomhukins (Curate) on Jun 05, 2001 at 22:53 UTC | |
Re: How do I go about Blessing an Object?
by nysus (Parson) on Jun 05, 2001 at 23:12 UTC | |
Re: How do I go about Blessing an Object?
by Anonymous Monk on Jun 05, 2001 at 23:42 UTC | |
Re: How do I go about Blessing an Object?
by Buckaroo Buddha (Scribe) on Jun 05, 2001 at 22:52 UTC |