I have no idea what dbmopen is, but I would seriously recommend
scrapping all of that and just going with DBI and DBD::ODBC (the DBI
driver that allows you to work with ODBC data sources).  Here's a small
example of how you can work with DBI to get data from a database using a
DSN you set up on the PC.

######################

use strict;
use warnings;
use DBI;
use DBD::ODBC; #this part is not usually necessary, 
               #but I include it because of other products I use
$| = 1;

print "Connecting to DB...\n\n";
my $dbh =
DBI->connect("dbi:ODBC:MyDSNName",'user','password',{odbc_default_bind_t
ype => 12}) or die("Couldn't connect to DB! ".$DBI::errstr);

my $select = "SELECT * FROM MyTable WHERE Name = 'tjohnson'";

print "Executing Query...\n\n";
my $sth = $dbh->prepare($select);
$sth->execute();

while( my $ref = $sth->fetchrow_hashref() ){
   foreach my $key( sort keys %$ref ){
      print "$key => ".$ref->{$key}."\n";
   }
}
print "\n\n";

########################

Note:  If you are not using Windows, then ignore the ODBC part and look
up the DBD:: module for your particular database (DBD::MySQL, for
example)


-----Original Message-----
From: hOURS [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006 8:12 AM
To: beginners@perl.org
Subject: database troubles

Hi,
  I'm new to the list.  Thanks everyone for having/doing this.
  
  I want to use PERL to work with a database, but I can't seem to get
PERL to open the databases on my computer.  <snip>
  
  %A = ();
  dbmopen(%A, "hOURSexperim.dbf", 0600) or die "Not gonna open it.\n";
  
<snip>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to