Try, this code and check out whether you had implemented the
appropriate driver....
here is the code..
*********************************
#!/usr/local/bin/perl -w
use DBI;
use strict;
my(@drivers);
@drivers = DBI->available_drivers;
foreach(@drivers) {print $_,"\n";}
************************************
Get back with the result of this code!
bye!
-END-
On Fri, 6 Jul 2001, Neil Lunn wrote:
> The Script is fine so ther is something wrong with your installation. The
> output of perl -V and the output of your DBI build would be helpful.
>
> If you don't know how to do this:
>
> tar zxvf DBI-x.xx.tar.gz
> cd DBI-x.xx
> perl Makefile.PL 2>&1 | tee log-conf
> make 2>&1 | tee log-make
> make test 2>&1 | tee log-test
>
> Paste the text from log-conf, log-make and log-test into your message.
>
> At a stab I would guess your old perl still resides on your system in
> another directory in your path, say /usr/local.
>
> -Neil
>
>
> >-----Original Message-----
> >From: anshuman das [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, July 06, 2001 7:53 PM
> >To: [EMAIL PROTECTED]
> >Cc: [EMAIL PROTECTED]
> >Subject: RE: Can't locate objrect method "connect" via package "DBI"
> >
> >
> >hi
> >
> >this is the smallest part of my code.
> >
> >**************************************************
> >#!/usr/bin/perl -w
> >#this is test.pl
> >
> >use strict;
> >use DBI;
> >
> >my $dbname = 'dcm_server';
> >my $datasource = 'dbi:Pg:dbname=dcm_server';
> >my $username = 'anshu';
> >my $auth = 'anshu';
> >my $host = '192.168.0.2';
> >
> >print "Trying to connect to database\n";
> >my $dbh =
> >DBI->connect("dbi:Pg:dbname=$dbname;host=$host;","$username","$
> >auth",{AutoCommit=>0});
> >
> >if ($dbh) { # If successfully connected
> > print "Connected to database\n";}
> >else {
> > print "Error Connecting to database\n";}
> >
> >****************************************************
> >
> >the error is :
> >Can't locate object method "connect" via package "DBI" at
> >test.pl line 14.
> >
> >I have recently upgraded my system RHLinux 6.2 -> RHLINUX 7
> >this upgradation made following changes
> >PostgreSQL 6.5 -> 7
> >Perl 5 -> perl 5.6.0
> >I installed DBI(1.14) and DBD manually.
> >
> >Before upgradation, my code was performing very well.
> >
> >Can you help me out?
> >
> >Regards
> >
> >Anshuman
> >[EMAIL PROTECTED]
> >
> >
> >>From: "Sterin, Ilya" <[EMAIL PROTECTED]>
> >>To: anshuman das <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> >>Subject: RE: Can't locate objrect method "connect" via package "DBI"
> >>Date: Thu, 5 Jul 2001 22:21:07 -0400
> >>
> >>Well let see the code, versions of DBI/DBD.
> >>
> >>Ilya
> >>
> >> > -----Original Message-----
> >> > From: anshuman das [mailto:[EMAIL PROTECTED]]
> >> > Sent: Thursday, July 05, 2001 4:12 AM
> >> > To: [EMAIL PROTECTED]
> >> > Subject: Can't locate objrect method "connect" via package "DBI"
> >> >
> >> >
> >> > Hi
> >> >
> >> > I have upgraded my machine as following
> >> >
> >> > RHLinux 6,.2 --> 7.0
> >> > PostgreSql 65. --> 7.0
> >> > Perl 5 -->Perl 5.6
> >> >
> >> > I have installed DBI & DBD again after the upgradation.
> >> > My problem is my old perl codes (which were running
> >perfectly before
> >> > upgradation) uses connect are not running. It can't
> >connect postgresql
> >> > databse through DBI. The error is ---
> >> > Can't locate objrect method "connect" via package "DBI"
> >> >
> >> > I posted this letter earlier, somebody asked me wheather I used
> >> > use DBI. THe
> >> > answer yes, I mentioned that MY CODES WERE RUNNING PERFECTLY BEFORE
> >> > UPGRADATION.
> >> >
> >> > Please help.
> >> >
> >> > Anshuman Das
> >> > [EMAIL PROTECTED]
> >> >
> >>______________________________________________________________
> >___________
> >> > Get Your Private, Free E-mail from MSN Hotmail at
> >>http://www.hotmail.com.
> >
> >_______________________________________________________________
> >__________
> >Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
>
> __________________________________________________________________________
> Please Note :
> Only the intended recipient is authorised to access or use this e-mail. If
> you are not the intended recipient,
> please delete this e-mail and notify the sender immediately. The contents
> of this e-mail are the writer's
> opinion and are not necessarily endorsed by the Gunz Companies unless
> expressly stated.
>
> We use virus scanning software but exclude all liability for viruses or
> similar in any attachment.
>