I am new to using perl and am trying to read data from an ms access database.
I have opened the database and can extract data from a table with limited success.
What I have done so far is open the database using
use Win32::ODBC;
etc
Then I have the following code:
This works ok as the first 10 rows are extracted from the table I have selected.
But when I use
the first record extracted is number 2 in the table and from then on only every second record is extracted form the table.
Could someone tell me what is going on please?
Thanks
Chris
I have opened the database and can extract data from a table with limited success.
What I have done so far is open the database using
use Win32::ODBC;
etc
Then I have the following code:
Code:
#while ($db->FetchRow()) {
while ($i<10) {
$db->FetchRow() ;
my %Data = $db->DataHash();
print $i," ",$Data{Au_plot},"," ;
print $Data{Cu},"," ;
print $Data{Zn},"," ;
print $Data{Pb};
$i++;
print "\n";
}
But when I use
Code:
while ($db->FetchRow()) {
instead of
while ($i<10) {
Could someone tell me what is going on please?
Thanks
Chris
Comment