CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
Can't locate object method "connect" via package "dbi"...

 



peji
Novice

Feb 17, 2003, 5:22 AM

Post #1 of 8 (7885 views)
Can't locate object method "connect" via package "dbi"... Can't Post

i keep on getting this message..i have already installed dbi..is the problem in my code (sample code)
*********
use DBI;
$driver = "dbi";
$database = "infordb";
$user="zup";
$password="zuppie";
$dsn = "DBI:$driver:database=$database;host=$hostname";
$dbh = dbi->connect($dsn, $user, $password);
*******
another thing... i cant install dbd-mysql coz "dbd-mysql is not intended for my perl build (MSWin32-x86-multi-thread)"... does this mean i have to install another version of perl?... any help is highly appreciated...thanks..
cowit crackling


Paul
Enthusiast

Feb 17, 2003, 6:43 AM

Post #2 of 8 (7883 views)
Re: [peji] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

Pay more attention to case.

dbi->connect

...is not the same as:

DBI->connect


peji
Novice

Feb 17, 2003, 7:17 AM

Post #3 of 8 (7879 views)
Re: [Paul] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

thanks a lot!

..but i have one more prob...

**********
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Database handle destroyed without explicit disconnect.

**********
What does this mean?...i'm totally new to this and no one to teach me...
cowit crackling


erichmusickwc
Novice

Mar 4, 2003, 3:08 PM

Post #4 of 8 (7855 views)
Re: [peji] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

Hmm....

First off one problem I see in the code is that you set $driver equal to dbi. What should go here is a special code for the database software you are running. For example, I use DBI with mysql, so I would put mysql for $driver.

Second, try adding $dbh->disconnect(); after the code you listed. (This should fix the warning "Database handle destroyed without explicit disconnect."

Also, do you print the content-type header anywhere?


peji
Novice

Mar 5, 2003, 2:14 AM

Post #5 of 8 (7851 views)
Re: [erichmusickwc] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

great! thanx man! :)
cowit crackling


Jasmine
Administrator / Moderator

Mar 5, 2003, 7:43 AM

Post #6 of 8 (7849 views)
Re: [peji] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

Sounds like you may have forgotten to $dbh->disconnect();


Paul
Enthusiast

Mar 5, 2003, 10:40 AM

Post #7 of 8 (7847 views)
Re: [Jasmine] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

That shouldn't cause a fatal error. I guess the error can be seen in the error log.


peji
Novice

Mar 9, 2003, 2:55 AM

Post #8 of 8 (7838 views)
Re: [Paul] Can't locate object method "connect" via package "dbi"... [In reply to] Can't Post

thankx guys!:)
cowit crackling

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives