On Thu, Apr 14, 2011 at 10:04 AM, Ritesh <rmotip...@gmail.com> wrote: > I am on an XP machine with ActivePerl installed along with DBI driver, > DBD::DB2 driver > I am following instructions per this webpage: > http://www.ibm.com/developerworks/data/library/techarticle/dm-0512greenstein/ > > I am running a simple script to connect to a DB2 database, but the following > error. > ################################################ >>perl dbaseConnect.pl <username> <password> > DBD::db2 initialisation failed: Can't locate object method "driver" via > package > "DBD::db2" at E:/Perl/site/lib/DBI.pm line 815. > > Perhaps the capitalisation of DBD 'db2' isn't right. at dbaseConnect.pl line > 10
I would say that the above error is pretty self explanatory. > #!/usr/bin/perl > use DBI; > $db2user = $ARGV[0]; > $pasw = $ARGV[1]; > > # Open a connection > $dbh = DBI->connect( "dbi:db2:<database>:<Server>:50000", $db2user, $pasw ) > or die "Can't connect to sample database: $DBI::errstr"; The web page you linked above has the following example database handle: $dbh = DBI->connect ("dbi:DB2:dbalias", $UserId, $password); Do you see the difference between the example database handle and your database handle? Thanks, Brian