In your connect string, connect as the user 'Admin' like so:
$dbh = DBI->connect('dbi:ODBC:myDSN', 'Admin','');

As far as I can recall, Admin is the default user if you haven't done anything
special to secure the database to require users to log on.  If you don't log in
as Admin, then you'll get permission errors on the tables.




"Krung Saengpole" <[EMAIL PROTECTED]> on 05/23/2001 03:46:56
AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  Newbie Q. : fetchrow_array.


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