perl query, please clear my doubt.

From: Chirag Idnani (chiragidnani_at_yahoo.com)
Date: 11/27/03


Date: Wed, 26 Nov 2003 20:46:38 -0800 (PST)
To: dbi-users@perl.org

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



Relevant Pages

  • Unexpected Transaction Commit in DBI / Apache::DBI
    ... I have been experiencing some problems with the following configuration: ... I'm using the following perl modules: ... DBI 1.46 ... mytable") or die $dbh->errstr; ...
    (perl.dbi.users)
  • Re: DBI query
    ... declare your variables (as local to the first usage as possible) ... manual of DBI. ... $sth->executeor die $DBI::errstr; ... - at this place in the code, not outside of the foreach loop. ...
    (perl.beginners)
  • mysql problem
    ... I am retrieving some data from a syslog mysql database: ... or die DBI->errstr; ... chomp $datetime; ... perldoc DBI etc. ...
    (perl.dbi.users)
  • Re: Cgi.pm and CSS
    ... use CGI qw; ... use DBI; ... or die $db->errstr; ... And the inner hashes contain the data ...
    (comp.lang.perl.misc)