Hello all,

I just start to learn dbi and have a problem with it. I use dbi to connect to Access 
database and fetch the data to array 'til end of file.
But it only showed 2 lines of data and error took place. No error code or message 
shown the reason why. My code is:

use DBI;

$dbh = DBI->connect('dbi:ODBC:myDSN', '','');
$sth = $dbh->prepare("Select * From TotalLevel");
$sth->execute();
while (@data = $sth->fetchrow_array) {
  foreach (@data){
    print "$_ \t";
  }
  print "\n";
}
$sth->finish;
$dbh->disconnect;

Any help would be appreciated. Thank you in advance.

Krung

Reply via email to