Hi folks,
 I've got the code below, which is suposed to be showing me the contents of a 
.dbf file.  However, whenever I try to run the program it fails to open the 
file. 

Can anyone tell me what I'm missing please (I've tried appending the .dbf but 
it made no difference).

[EMAIL PROTECTED] data]$ cat ~/t1
#!/usr/bin/perl -w
use DBI;
select(STDERR); $|=1;
select(STDOUT); $|=1;

my $dbh=DBI->connect("DBI:XBase:") || die "cannot connect: $DBI::errstr";
my $sth=$dbh->prepare('select * from vins;') || die "cannot select: 
$DBI::errstr;";
$sth->execute || die "cannot execute: $DBI::errstr";
while (my $rf=$sth->fetchrow_hashref) {
  foreach (keys %$rf) {
    print "$_=$rf->{$_}\n";
  }
}
$sth->finish;
$dbh->disconnect;

[EMAIL PROTECTED] data]$ ls -l vins.dbf
-rwxr--r--    1 gary     gary          285 Oct 13 16:55 vins.dbf

[EMAIL PROTECTED] data]$ ~/t1
DBD::XBase::st execute failed: Table vins; not found: Error opening file 
./vins;: No such file or directory
cannot execute: Table vins; not found: Error opening file ./vins;: No such 
file or directory
[EMAIL PROTECTED] data]$

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to