The only thing the program lacks is an eval around the data_sources
method call to cleanly catch drivers that are 'installed' but not
functional.

Tim.

On Wed, May 16, 2001 at 11:16:11AM -0400, Curt Russell Crandall wrote:
> Ignore that program... it almost NEVER works.  I'm on a Solaris box, it'll
> go through the ADO driver no problem, but I get a similar error when it
> hits the Oracle driver (can't locate DBD::Oracle).
> I've run this program on several different systems: Linux, Solaris, HP-UX,
> Irix with all sorts of DB's loaded on it and DBD drivers.  NEVER, EVER has
> this program worked correctly because it can't find one thing or
> another.  Not that the program code itself is to blame, but for some
> reason it fails to print out data sources, etc. etc. due to the setup.
> Also, I've never seen a Perl DBI install where DBD::ADO was NOT
> present.  Even if you load it onto a UNIX box, DBD::ADO always seems to be
> in the install... I haven't checked the manifest for DBI, but I'd be
> willing to bet you'd find that driver in there. But it is possible that
> the Win32 modules were not included in your Perl install.
> 
> So, if you are getting a problem with installing DBD::Sybase, I doubt it
> has anything to do with the error you got running that test
> script.  Do you have the OpenClient libs or the TDS libs installed on your
> machine?  DBD::Sybase won't install w/o them.  If that is not the case,
> I'd reinstall DBD::Sybase and send the error output here.
> 
> On Wed, 16 May 2001, Spohn, Albert  F. wrote:
> 
> > My initial install of DBI 1.15 bundle went without an apparent hitch.  I
> > then attempted to run the following code from the O'Reilly Perl DBI book to
> > see what drivers were installed (expecting to see either 'none' or maybe one
> > that came with the DBI 1.15 bundle). My knee-jerk reaction was to try to
> > install a driver, then try again - so I tried the Sybase 0.91 DBD, but it
> > wouldn't install cleanly... so I figured I better address the initial issue
> > first.  At any rate, here's the code:
> > 
> > #!/usr/bin/perl -w
> > use DBI;
> > 
> > my @drivers = DBI->available_drivers();
> > 
> > die "No drivers found!\n" unless @drivers;
> > 
> > foreach my $driver (@drivers ) {
> >         print "Driver: $driver\n";
> >         my @dataSources = DBI->data_sources ($driver);
> >         foreach my $dataSource  ( @dataSources ) {
> >                 print "\tData Source is $dataSource\n";
> >         }
> >         print "\n";
> > }
> > exit;
> > 
> > Here's the error I'm getting:
> > 
> > Driver: ADO
> > install_driver(ADO) failed: Can't locate Win32/OLE/Variant.pm in @INC (@INC
> > contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/pe.
> > BEGIN failed--compilation aborted at
> > /usr/lib/perl5/site_perl/5.005/i386-linux/DBD/ADO.pm line 562.
> > Perhaps a module that DBD::ADO requires hasn't been fully installed
> >  at ./dbi_test line 10
> > 
> > Here's my perl -V info:
> > 
> > Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
> >   Platform:
> >     osname=linux, osvers=2.2.14-5.0, archname=i686-linux
> >     uname='linux jesse 2.2.14-5.0 #1 tue mar 7 21:07:39 est 2000 i686
> > unknown '
> >     config_args=''
> >     hint=recommended, useposix=true, d_sigaction=define
> >     usethreads=undef use5005threads=undef useithreads=undef
> > usemultiplicity=undef
> >     useperlio=undef d_sfio=undef uselargefiles=define 
> >     use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
> >   Compiler:
> >     cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
> > (egcs-1.1.2 release)
> >     cppflags='-fno-strict-aliasing'
> >     ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE
> > -D_FILE_OFFSET_BITS=64'
> >     stdchar='char', d_stdstdio=define, usevfork=false
> >     intsize=4, longsize=4, ptrsize=4, doublesize=8
> >     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
> >     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> > lseeksize=8
> >     alignbytes=4, usemymalloc=n, prototype=define
> >   Linker and Libraries:
> >     ld='cc', ldflags =' -L/usr/local/lib'
> >     libpth=/usr/local/lib /lib /usr/lib
> >     libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
> >     libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
> >   Dynamic Linking:
> >     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
> >     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
> > 
> > 
> > Characteristics of this binary (from libperl): 
> >   Compile-time options: USE_LARGE_FILES
> >   Built under linux
> >   Compiled at Mar 31 2001 23:48:51
> >   @INC:
> >     /usr/local/lib/perl5/5.6.0/i686-linux
> >     /usr/local/lib/perl5/5.6.0
> >     /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
> >     /usr/local/lib/perl5/site_perl/5.6.0
> >     /usr/local/lib/perl5/site_perl
> >     .
> > 
> > Many thanks to whomever was willing to wade through this junk!  Any help
> > would be appreciated, of course.
> > 
> > - Al
> > 
> > Al Spohn
> > Publishing and Media Technology Services
> > Mayo Clinic 507-284-1666
> > 

Reply via email to