POSSIBLE BUG IN Win32 DBI INSTALL MODULE: DBI "prepare" no work FW: List 'dbi-users' closed to public posts

I have ActiveState Win32perl running.  I installed fresh DBI, DBD, etc. from
perl ppm.pl> prompt.  But prepare( ) doesn't work (see below).   perldoc
DBI/DBD/DBI-FAQ are not useful since they assume it works.  Any hints?

Art
www.mp3.com/ArthurSulit
Classical Artist
recently charted above Madonna


-----Original Message-----
From: Art Sulit [mailto:art@prs.net]
Sent: Saturday, January 20, 2001 1:51 PM
To: Webmaster@ActiveState.com
Subject: POSSIBLE BUG IN YOUR DBI INSTALL MODULE: DBI "prepare" no work



Hello,

THERE IS A POSSIBLE BUG IN YOUR DBI INSTALL MODULES:  prepare.al NOT PRESENT

As you know, prepare() is a CRITICAL SQL function, and needs to work.
Here's one example of many where mine does not work:

I'm using DBI, DBI:ODBC, DBD::ODBC for Win32 to talk to an MS Access
database called InventoryControl1.  I set up proper DSN's, etc. and those
work.  However, my $sth ... prepare doesn't work.  Errormsg is:

	"Can't locate auto/DBI/prepare.al in @INC (@INC contains C:/Perl/lib
C:/Perl/site/lib
		.) at dbi.pl line 29"

CREATE TABLE, however, works, so I know I have a successful database
connection.  why doesn't prepare() work????

Art Sulit  (simple code below)
650-330-8050

---------------------------------------------------------

#!/usr/local/bin/perl5 -w

use DBI;
use DBI::DBD;
use DBD::ODBC;
# use strict;

$db = "InventoryControl1"; # "InventoryControl1";	"ContactManagement1"
$user = "namie";
$password = "secretie";
$dbd = "ODBC"; # Microsoft Access Driver (*.mdb)
$dbhandle = DBI->connect($db, $user, $password, $dbd);
die "Error connecting to database, $DBI::errstr\n" if (!$dbhandle);


$dbhandle->do("CREATE TABLE losers3 (uid INT, login CHAR(8))")
	  or die "doing: ", $dbhandle->errstr;
$sth = DBI->prepare("SELECT * FROM Categories");
$sth->execute or die "executing: ", $sth->errstr;

$sth->finish;

$dbhandle->disconnect;

exit;


_______________________
Art Sulit <art@prs.net>
Classical Archives, LLC
Phone: 650-330-8050

Visit the Classical Archives
at http://www.prs.net/





---
Listar v1.0.0 - job execution complete.



0
art
1/26/2001 12:47:13 AM
perl.dbi.users 11100 articles. 1 followers. Follow

1 Replies
1526 Views

Similar Articles

[PageSpeed] 46

On Thu, Jan 25, 2001 at 04:47:13PM -0800, Art Sulit wrote:

Let's start with the basics. perldoc DBI

> #!/usr/local/bin/perl5 -w
> 
> use DBI;
> use DBI::DBD;
> use DBD::ODBC;

Neither the use DBI::DBD or DBD::ODBC are required.  Remove them.

> # use strict;
Leave this in!!
> 
> $db = "InventoryControl1"; # "InventoryControl1";	"ContactManagement1"
> $user = "namie";
> $password = "secretie";
> $dbd = "ODBC"; # Microsoft Access Driver (*.mdb)
> $dbhandle = DBI->connect($db, $user, $password, $dbd);

Let's look at how this expands.
connect( "InventoryControl1", "namie", "secretie", "ODBC" )

This is a very, very old connect method.  Change this to
DBI->connect( 'dbi:ODBC:InventoryControl1', $user, $password,
# and just for kicks
{ RaiseError => 1, PrintError => 1 } ) or die $DBI::errstr;
> 
> $dbhandle->do("CREATE TABLE losers3 (uid INT, login CHAR(8))")
> 	  or die "doing: ", $dbhandle->errstr;
Yes, the "do" does works.

> $sth = DBI->prepare("SELECT * FROM Categories");
         ^^^^^^^^^^^^
However, do we see a problem here?  The database connection is created
and the handle is stored in $dbhandle, however the prepare is
attempted as a DBI class constructor... not going to work.

Try $dbhandle->prepare( ... )

Tom

-- 
Thomas A. Lowery	stlowery@yahoo.com
http://tlowery.hypermart.net

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

0
stlowery
1/26/2001 2:12:26 AM
Reply:

Similar Artilces:

Can't install DBI on WinNT
Hi, I've fallen at the first hurdle while trying to install the DBI module. I've run Makefile.pl, however my system doesn't recognise the "make" command which the readme.txt states that I should run. I've also tried to install the package via PPM (ActivePerl v 617), however it can't find the DBI module or any other module. Any ideas? Thanks Chris Perl / SGML Developer e-access Public Record Office, Kew Richmond Surrey, TW9 4DU UK Tel: (0208) 392 5300 ext 2213 http://www.pro.gov.uk/ --------------------------------------------------...

[perl5-dbi/dbi] 0c17b7: Include Jens' work for DBI-Test
----==_mimepart_521d9d9e8d573_74699e7d4814086d Date: Tue, 27 Aug 2013 23:50:06 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <521d9d9e8e411_74699e7d48140935@hookshot-fe4-pe1-prd.aws.github.net.mail> Branch: refs/heads/dir_search_hashes Home: https://github.com/perl5-dbi/dbi Commit: 0c17b78ff80873945276cd8ffc08876be8ebfd8d https://github.com/perl5-dbi/dbi/commit/0c17b78ff80873945276cd8ffc08876be8ebfd8d Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl> Date: 2013-08-12 (Mon, 12 Aug 2013)...

multiple DBI::Format's in CPAN installing to different locations, and $VERSION bug in DBI-Shell-11.9/lib/DBI/Format/SQLMinus.pm
DBI::Format comes with DBI-1.32 in lib/DBI/Format.pm as VERSION 11.4 and DBI-Shell-11.9 in lib/DBI/Format.pm as VERSION 11.8 According to the .packlist files DBI installs Format.pm in /usr/local/lib/perl5/site_perl/5.9.0/i686-linux/DBI but DBI/Shell installs the newer version in /usr/local/lib/perl5/site_perl/5.9.0/DBI/Format.pm In my @INC, /usr/local/lib/perl5/site_perl/5.9.0/i686-linux (where DBI installs the older Format.pm) comes before /usr/local/lib/perl5/site_perl/5.9.0 (where the newer DBI-Shell is installed) This causes the older DBI::...

FW: HELP ME !! Can't locate object method "connect" via package " DBI"
German, Estoy apesadumbrado. No tengo ninguna experiencia con el perlcc. --Thunder dbi-users, TRANSLATION: "When I execute with Perl, I don't have any problems. When I do an executable with perlcc, at the moment I execute the archive, I get the message 'Can't locate object method connect via package DBI' " -----Original Message----- From: GermanMarambio@vtr.cl [mailto:GermanMarambio@vtr.cl] Sent: Monday, June 24, 2002 8:47 AM To: PARLEY,JON (HP-MountainView,ex1) Subject: RE: HELP ME !! Can't locate object method "connect" via = ...

[perl5-dbi/dbi] f2a2df: Fix handling "0" different from ""
----==_mimepart_51c872f8ae5a3_3c05cc1dd4103275 Date: Mon, 24 Jun 2013 09:25:28 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <51c872f8aefbc_3c05cc1dd41033ad@hookshot-fe2-pe1-prd.aws.github.net.mail> Branch: refs/heads/master Home: https://github.com/perl5-dbi/dbi Commit: f2a2df0d62405a7e5d58d9a83edacd5acaef82e0 https://github.com/perl5-dbi/dbi/commit/f2a2df0d62405a7e5d58d9a83edacd5acaef82e0 Author: Jens Rehsack <sno@netbsd.org> Date: 2013-06-24 (Mon, 24 Jun 2013) Changed paths: ...

[perl5-dbi/dbi] 3b5b5a: Add "or again" to "perhaps you need to call execut...
----==_mimepart_52f3839f43fa5_749e12a3d38456b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Branch: refs/heads/master Home: https://github.com/perl5-dbi/dbi Commit: 3b5b5a5f3ab4797f3e85d2f0ee244897ad47377a https://github.com/perl5-dbi/dbi/commit/3b5b5a5f3ab4797f3e85d2f0ee244897ad47377a Author: Tim Bunce <Tim.Bunce@pobox.com> Date: 2014-02-06 (Thu, 06 Feb 2014) Changed paths: M DBI.pm M DBI.xs Log Message: ----------- Add "or again" to "perhaps you need to call execute first" errstr for...

[perl5-dbi/dbi] a76aff: VMS indicates current dir with "[]" instead of "./...
----==_mimepart_51d2bd293234e_19d3a37dd456168 Date: Tue, 02 Jul 2013 04:44:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <51d2bd293553c_19d3a37dd4562cc@hookshot-fe5-pe1-prd.aws.github.net.mail> Branch: refs/heads/master Home: https://github.com/perl5-dbi/dbi Commit: a76aff93ffd65059efb807395bdb44f13f681c3e https://github.com/perl5-dbi/dbi/commit/a76aff93ffd65059efb807395bdb44f13f681c3e Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl> Date: 2013-07-02 (Tue, 02 Jul 2013) Changed...

"Can't locate loadable object for module DBI "
------=_NextPart_000_0005_01C11F89.12E6F0F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, Can anybody suggest what's the problem with this Perl Script. In the beginning I had this problem. Can't locate DBI.pm in @INC (@INC contains: = /opt/portal/6.0/lib/perl5/sun4-solaris/5.00503 /opt/portal/6.0/lib/perl5 = /opt/portal/6.0/lib/perl5/site_perl/sun4-solaris /opt/portal/6.0/lib .) = at ./cust.pl line 7. BEGIN failed--compilation aborted at ./cust.pl line 7. Then I installed the DBI.pm as per instruction...

Can't locate object method "trace_msg" via package "DBI"
Please help in order to fix the problem, I am newbie in the httpd.conf I have put the bellow lines: Alias /perl/ /usr/apache/perl5/5.005/i86pc-solaris/Apache/ PerlModule DBI When I try to run the httpd I get: Can't locate object method "trace_msg" via package "DBI" at /usr/perl5/site_perl/5.005/i86pc-solaris/DBI.pm line 341. END failed--cleanup aborted. run: Error 0 I am using the bellow software: OS: solaris 8/intel httpd: apache 1.3.20 mysql: 3.23.38-1 DBI: 1.18 (I have compiled using gcc) Thank you in advance Why do you put that in http...

Can't locate object method "connect" via package "DBI"
------=_NextPart_000_001B_01C102EB.C7598F30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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&qu...

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 BEFOR...

Can't locate objrect method "connect" via package "DBI" #2
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 "Co...

HELP ME !! Can't locate object method "connect" via package "DBI"
Hi dears Excuseme, my english is very poor. My Name is Germ=E1n i live in Chile(South America), i have the followin= g problem: "can't locate object method "connect" via package "DBI". If your have the solution.... help me, please...!!! How can solution? Thanks a lot Muy atentamente, Germ=E1n Marambio Vargas= On Mon, 24 Jun 2002 11:23:51 -0400, GermanMarambio@vtr.cl wrote: >i have the following >problem: "can't locate object method "connect" via package >"DBI". Does your script even do: use ...

HELP ME !! Can't locate object method "connect" via package "DBI"
Hi, i did modify the source code. I change use for require, Now appears th= e following message: Can't load module DBI, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the DBI module statically linked into it.) at /usr/local/lib/perl5/site_perl/5.005/aix/DBI.pm line 158 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/aix/DBI.pm line 158. This is the new source code: #!/usr/local/bin/perl -w require DBI;require DBD::Oracle; { $v_dbname =3D $ENV{...

Web resources about - POSSIBLE BUG IN Win32 DBI INSTALL MODULE: DBI "prepare" no work FW: List 'dbi-users' closed to public posts - perl.dbi.users

Resources last updated: 1/20/2016 10:29:44 PM