Hello sir/madam,
I am trying out a few sample perl programs to connect to a database ( i.e
msaccess using perl), i have been able to install dbi.pm on my machine but still when
i run the script i get the following error:
This is the error:
Can't locate object method "connect" via package "DBI" (perhaps you forgot to load
"DBI"?) at conn.pl line 12.
Here is the script that i am running:
#! c:\perl\bin\perl.exe
use DBI;
my $dbh = DBI->connect('DBI:ODBC:staff');
my $sqlCmd = "SELECT * FROM staff;";
my $sthCmd = $dbh->prepare('$sqlCmd') or die;
$sthCmd->execute or die;
exit(0);
I presume that the installation of DBI has not been done properly, can you kindly
provide me with the exact installation procedure of DBI on windows or any other
suggestion that you think could solve the problem.
Thanking you,
Yours Sincerely,
Chirag Idnani
---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now