Hello,
I am a perl pup, but I'm able to make stuff work pretty well. I've delved into attempting to work with a MS Access database, and I'm hitting a brick wall. This is also my first MS PERL experience.
I've seen this error addressed plenty of times, but none of the answers have seemed to offer me any real assistance. Firstly, I can open this db in Access with no problem.
So, with the code below, I get the response listed below it.
#!"c:\documents and settings\user\perl\bin\perl"
use DBI;
use strict;
my $adb = 'testdb.mdb';
my $driver = 'driver=Microsoft Access Driver(*.mdb);dbq=';
my $dstring = $driver . $adb;
my $dbh = DBI->connect("DBI:ODBC:$dstring","","");
# || die; # "$DBI::errstr";
my @avail = DBI->available_drivers;
print "--$_--\n" foreach(@avail);
my %drivers = DBI->installed_drivers();
while (my($k,$v)=each(%drivers))
{
print "Driver:$k\t-\t$v\n";
}
$dbh->disconnect;
Output to screen below
DBI connect('driver=Microsoft Access Driver(*.mdb);dbq=testdb.mdb','',
+..
.) failed: [Microsoft][ODBC Driver Manager] Data source name not found
+ and no de
fault driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1) at
+ C:\temp\t
emp.pl line 14
--DBM--
--ExampleP--
--File--
--Gofer--
--ODBC--
--Proxy--
--SQLite--
--Sponge--
Driver:ODBC - DBI::dr=HASH(0x1a4d5c4)
Can't call method "disconnect" on an undefined value at C:\temp\temp.p
+l line 27.
Any help with this is GREATLY appreciated