You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Patrix Diradja <pa...@yahoo.co.id> on 2007/02/06 14:29:22 UTC

Where does "MoveNext" belong to?

Dear my friends....

I am writing a program use activeperl 5.8, MSSQL and
on Win32 Env.

Here is my code:
===
#!/usr/bin/perl
use Tk;
use Cwd;
use DBI::ADO;
use WriteExcel;
use strict;
use Win32::OLE qw( in );

my $dsn="sigma";
my $uname="sa";
my $pword="penguin";
my @bd4l=("AprovaApp1");

my $strsqltab4l="select name from sys.tables";
my $dbh2 = DBI->connect("dbi:ADO:$dsn", $uname,
$pword)
   || die "Could not open SQL connection.";
my $rsnya = $dbh2->prepare($strsqltab4l);
$rsnya->execute();

while(!$rsnya->{EOF}){
    my $tab4l = $rsnya->fetchrow_array;
    print "\$tab4l: $tab4l \n";
    $rsnya->movenext;
}
====
but than comes problem that I can not solve.

The error message is:
"
Can't get DBI::st=HASH(0x1d2d3f4)->{EOF}: unrecognised
attribute name at C:/Perl/site/lib/DBD/ADO.pm line
1277.
Can't locate object method "movenext" via package
"DBI::st" at Untitled1 line 23.
"

Please tell me why.

Thank you very much in advance.



	

	
		
________________________________________________________ 
Sekarang dengan penyimpanan 1GB 
http://id.mail.yahoo.com/

Re: Where does "MoveNext" belong to?

Posted by Robert Landrum <rl...@aol.net>.
Patrix Diradja wrote:
> while(!$rsnya->{EOF}){
>     my $tab4l = $rsnya->fetchrow_array;
>     print "\$tab4l: $tab4l \n";
>     $rsnya->movenext;
> }

Not a mod_perl question, per se, but try

while(my $tab4l = $rsnya->fetchrow_array) {
   print "\$tab4l: $tab4l\n";
}

Rob