ChewDoggie
Programmer
Hello all,
I'm an old-hat VB6 developer who's trying to write my first Perl DBI script. In VB6, one would create a connection object ("cn", e.g.), instantiate it, create your connection string and the pass it to the "Open" method to open a connection to a database.
I've been reading the tutorial suggested by the Perl FAQ located at and it has been VERY helpful. It says to provide the database driver for the database. So, my code currently looks like this for connecting to an Access Database:
And I keep receiving this error:
Can't locate auto/DBI/Connect.al in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at dbi.pl line 11
at C:/perl/lib/AutoLoader.pm line 47
AutoLoader::AUTOLOAD('DBI', 'DBI:CSV:f_dir=C
rogram FilesMicrosoft Visual StudioVB98MS.MDB') called at dbi.pl line 11
Do I have to include a a "use lib" command? I thought that the "use DBI" statement was sufficient. I went to both of those directories and there's no "Connect.al" file or directory. BTW, I'm on a Windows XP machine running ActivePerl. I installed DBI via the PPM utility that comes with ActivePerl. Can anyone assist me with my errant code?
Thanks!
Chewdoggie
The True measure of an individual is how he treats a person who can do him absolutely no good.
I'm an old-hat VB6 developer who's trying to write my first Perl DBI script. In VB6, one would create a connection object ("cn", e.g.), instantiate it, create your connection string and the pass it to the "Open" method to open a connection to a database.
I've been reading the tutorial suggested by the Perl FAQ located at and it has been VERY helpful. It says to provide the database driver for the database. So, my code currently looks like this for connecting to an Access Database:
Code:
use DBI;
use strict;
my ($dbh,
$sth,
$dir,
@row);
$dir = "C:/Program Files/Microsoft Visual Studio/VB98/EMS.MDB";
$dbh = DBI->Connect("DBI:CSV:f_dir=$dir") or die "Couldn't connect to the daggone database" . $dbh->errstr . "\n";
$sth = $dbh->prepare('Select * from classes') or die "Couldn't prepare the daggone sql string" . $dbh->errstr . "\n";
$sth->execute();
And I keep receiving this error:
Can't locate auto/DBI/Connect.al in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at dbi.pl line 11
at C:/perl/lib/AutoLoader.pm line 47
AutoLoader::AUTOLOAD('DBI', 'DBI:CSV:f_dir=C
Do I have to include a a "use lib" command? I thought that the "use DBI" statement was sufficient. I went to both of those directories and there's no "Connect.al" file or directory. BTW, I'm on a Windows XP machine running ActivePerl. I installed DBI via the PPM utility that comes with ActivePerl. Can anyone assist me with my errant code?
Thanks!
Chewdoggie
The True measure of an individual is how he treats a person who can do him absolutely no good.