From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrix
Diradja
Sent: 06 February 2007 09:22
To: [email protected]
Subject: Who 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 strict;' is better placed here, as is 'use warnings;'.

> use Tk;
> use Cwd;
> use DBI::ADO;

I am not aware of any such module (there doesn't seem to be one in
CPAN). Perhaps you meant 'use DBI;'. Are you sure that this is really
your code?

> 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}){

I can see no mention of EOF as a statement handle attribute in the
documentation. Where does this come from?

>     my $tab4l = $rsnya->fetchrow_array;

You are aware that fetchrow_array returns an array, not a scalar, and
evaluating it in a scalar context results in your variable $tab4l is
initialised to the number of elements in the array.

>     print "\$tab4l: $tab4l \n";
>     $rsnya->movenext;

That is not a member function of a DBI statement handle as fare as I can
see. Where did you see that documented?

> }
> ====
> 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.

You appear to be making stuff up and wondering why it doesn't work. I
suggest reading the DBI documentation again, particularly the part on
statement handles which you seem to be having problems with. Also, the
web site (http://dbi.perl.org/) is a useful resource, and I can
recommend the book "Programming the Perl DBI".

Your while loop might work better like this:

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

HTH

-- 
Brian Raven 

=========================================
Atos Euronext Market Solutions Disclaimer
=========================================

The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with 
registration no. 3962327.  Registered office address at 25 Bank Street London 
E14 5NQ United Kingdom. 
Atos Euronext Market Solutions SAS - Registered in France with registration no. 
425 100 294.  Registered office address at 6/8 Boulevard Haussmann 75009 Paris 
France.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au 
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank 
Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré 
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris 
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to