RE: Apache::DBI::connect problem, please help

2001-02-21 Thread Brad Howerter

Thank you, Geoff and Arun.  I am doing it the way you suggest.

My problem turned out to be a bad installation of Apache::DBI.pm.
(it was just a copy of DBI.pm).

> -Original Message-
> From: Arun Theeban [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 20, 2001 11:39 PM
> To: Geoffrey Young; 'Brad Howerter'; '[EMAIL PROTECTED]'
> Subject: RE: Apache::DBI::connect problem, please help
> 
> 
> You have to put Apache::DBI before any of the DBI's
> you are using in httpd.conf file.
> 
> In your cgi programs use only "DBI" not "Apache::DBI"
> module.
> 
> a simple program would be.
> 
> #! /usr/bin/perl
> print "Content-type:text/html\n\n";
> $dbh=DBI->connect("DBI::Pg::dbname=emp","user","passwod");
> print " connected successfully ";
> $dbh->disconnect;
> 
> if Apache::DBI was loaded before DBI, some of the
> fuctions would be overridden.
> 
> Even if you give $dbh->disconnect,Apache::DBI will
> override funtion to nothing.
> -Arun
> 
> --- Geoffrey Young <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > > -Original Message-
> > > From: Brad Howerter [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, February 20, 2001 12:57 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: Apache::DBI::connect problem, please
> > help
> > > 
> > [snip]
> > > So Apache/DBI.pm must be installed incorrectly on
> > my system.
> > > It's supposed to be different from the DBI.pm?
> > 
> > yup, you need both.  DBI is, well, DBI.  Apache::DBI
> > is a persistent
> > framework under mod_perl that uses DBI.
> > 
> > HTH
> > 
> > --Geoff 
> k
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices! 
http://auctions.yahoo.com/



RE: Apache::DBI::connect problem, please help

2001-02-20 Thread Brad Howerter


> > > From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> > > you need both, DBI and Apache::DBI, with DBI loaded first...
> > 
> > I tried this, but I still get the same error.
> 
> sorry, I gave you bad information - Apache::DBI needs to be 
> loaded first...
> it was late :)

That's okay- I've tried it both ways, and I get the same result.

> 
> use Apache::DBI;
> use DBI;
> 
> > > 
> > > see the Apache::DBI manpage for more detail
> > 
> > That man page is the same as the DBI manpage- it doesn't include
> > any modperl specific information.
> 
> um, not so...  man Apache::DBI and man DBI should definitely 
> yield different
> results.

So Apache/DBI.pm must be installed incorrectly on my system.
It's supposed to be different from the DBI.pm?



RE: Apache::DBI::connect problem, please help

2001-02-20 Thread Brad Howerter



> From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> you need both, DBI and Apache::DBI, with DBI loaded first...

I tried this, but I still get the same error.
> 
> see the Apache::DBI manpage for more detail

That man page is the same as the DBI manpage- it doesn't include
any modperl specific information.

> -Original Message-
> From: Brad Howerter
> To: '[EMAIL PROTECTED]'
> Sent: 2/19/01 6:54 PM
> Subject: Apache::DBI::connect problem, please help
> 
> I'm getting this error:
> 
> [error] Can't locate object 
> method "connect" via package "Apache::DBI::connect" at
>  /usr/local/lib/perl5/site_perl/5.6.0/i386-dynixptx/DBI.pm line 408.
> 
> One way I can avoid the error is to change startup.pl 
> to use DBI() instead of use Apache::DBI().  Why does that 
> fix it?  And does it hurt anything if I don't use Apache::DBI()? 
> What's that for, anyway?  Is Apache/DBI.pm supposed to be 
> the same as the other one in the perl library?  (It is)
> 
> my startup.pl has this in it:
> 
> #!/usr/bin/perl
> use strict;
> $ENV{MOD_PERL} or die "Not running under mod_perl!";
> 
> use Apache::Registry;
> use Apache::DBI ();
> 
> # Tell me more about warnings
> use Carp;
> $SIG{__WARN__} = \&Carp::cluck;
> 
> use CGI qw(-compile :all);
> 1;
> 
> and my test program is this:
> 
> #!/usr/local/bin/perl
> use strict;
> 
> use Carp;
> $SIG{__WARN__} = \&Carp::cluck;
> 
> use DBI;
> use DBD::Oracle;
> use CGI ();
> 
> my $cgi = new CGI;
> print $cgi->header; my $db = DBI->connect('', 'scott', 
> 'tiger', { } ) or
> die
> DBI::errstr;
> print "Connected!\n";
> 



Apache::DBI::connect problem, please help

2001-02-19 Thread Brad Howerter

I'm getting this error:

[error] Can't locate object 
method "connect" via package "Apache::DBI::connect" at
 /usr/local/lib/perl5/site_perl/5.6.0/i386-dynixptx/DBI.pm line 408.

One way I can avoid the error is to change startup.pl 
to use DBI() instead of use Apache::DBI().  Why does that 
fix it?  And does it hurt anything if I don't use Apache::DBI()? 
What's that for, anyway?  Is Apache/DBI.pm supposed to be 
the same as the other one in the perl library?  (It is)

my startup.pl has this in it:

#!/usr/bin/perl
use strict;
$ENV{MOD_PERL} or die "Not running under mod_perl!";

use Apache::Registry;
use Apache::DBI ();

# Tell me more about warnings
use Carp;
$SIG{__WARN__} = \&Carp::cluck;

use CGI qw(-compile :all);
1;

and my test program is this:

#!/usr/local/bin/perl
use strict;

use Carp;
$SIG{__WARN__} = \&Carp::cluck;

use DBI;
use DBD::Oracle;
use CGI ();

my $cgi = new CGI;
print $cgi->header; my $db = DBI->connect('', 'scott', 'tiger', { } ) or die
DBI::errstr;
print "Connected!\n";