1) Thanks for the tips and thanks for the advice about optimizing use of
ADO.  The tips will help me finish my nearly complete initial design, and it
looks like your advice will help me design a cleaner solution when I go back
and optimize.

2) Thanks for the reference to Ron Savage's tutorial page
(http://savage.net.au/Perl-tutorials.html).
                -- David Innes

By the way I should have disclaimed in my original post that I'm a relative
Perl newbie.  Thanks to all for your patience.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ron
Grabowski
Sent: Saturday, January 27, 2001 6:12 PM
To: David Innes
Cc: [EMAIL PROTECTED]
Subject: Re: Extracting database field/form names with ASP/ADO and
PerlScript


> The basic question is what's the ASP/PerlScript way to fetch a row of data
> into a hash the way DBI's fetchrow_hashref() does?

If you know DBI, why not use it? It sounds like the right tool for the
job in your case.

Ron Savage has a tutorial on using DBI with ADO:

 http://savage.net.au/Perl-tutorials.html#tut-12

> The basic question is what's the ASP/PerlScript way to fetch a row of data
> into a hash the way DBI's fetchrow_hashref() does?

Its more ADOish ( not to mention faster ) to use GetRow(), GetString(),
or iterate through the recordset object with MoveNext() rather than copy
the value into another data structure and then reprocess the
information.

You could very easily roll your own using these:

 $rs->Fields->{Count};      # number of columns for this row
 $rs->Fields( N )->{Name};  # name of the Nth column
 $rs->Fields( N )->{Value}; # value of the Nth column

# extract column names from first record
for my $i ( 0 .. $rs->Fields->{Count}-1 ) {
 $names{ $rs->Fields(0)->{Name} } = $i;
}

foreach my $column ( sort { $names{$b} <=> $names{a} } keys %names ) {
  $Response->Write("'$column' is the name of column
[$names{$column}]<br>");
}

- Ron
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
1) Thanks for the tips and thanks for the advice about optimizing use of
ADO.  The tips will help me finish my nearly complete initial design, and it
looks like your advice will help me design a cleaner solution when I go back
and optimize.

2) Thanks for the reference to Ron Savage's tutorial page
(http://savage.net.au/Perl-tutorials.html).
                -- David Innes

By the way I should have disclaimed in my original post that I'm a relative
Perl newbie.  Thanks to all for your patience.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ron
Grabowski
Sent: Saturday, January 27, 2001 6:12 PM
To: David Innes
Cc: [EMAIL PROTECTED]
Subject: Re: Extracting database field/form names with ASP/ADO and
PerlScript


> The basic question is what's the ASP/PerlScript way to fetch a row of data
> into a hash the way DBI's fetchrow_hashref() does?

If you know DBI, why not use it? It sounds like the right tool for the
job in your case.

Ron Savage has a tutorial on using DBI with ADO:

 http://savage.net.au/Perl-tutorials.html#tut-12

> The basic question is what's the ASP/PerlScript way to fetch a row of data
> into a hash the way DBI's fetchrow_hashref() does?

Its more ADOish ( not to mention faster ) to use GetRow(), GetString(),
or iterate through the recordset object with MoveNext() rather than copy
the value into another data structure and then reprocess the
information.

You could very easily roll your own using these:

 $rs->Fields->{Count};      # number of columns for this row
 $rs->Fields( N )->{Name};  # name of the Nth column
 $rs->Fields( N )->{Value}; # value of the Nth column

# extract column names from first record
for my $i ( 0 .. $rs->Fields->{Count}-1 ) {
 $names{ $rs->Fields(0)->{Name} } = $i;
}

foreach my $column ( sort { $names{$b} <=> $names{a} } keys %names ) {
  $Response->Write("'$column' is the name of column
[$names{$column}]<br>");
}

- Ron
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to