Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I would appreciate any help on configuring the DBI module for ActivePerl 5.8. I'm wanting to read information stored in Microsoft Access. I assume that I also need the DBD-ODBC module to access the database's DSN.

I've successfully installed ActivePerl and have been using it for quite some time. I've downloaded both:

and ran

ppm install DBI.ppd
ppm install DBD-ODBC.ppd

The install for the DBI module claims success, but attempting to install the ODBC module yields:

Error: no suitable installation target found for package DBD-ODBC.

What gives? Thanks for any information that you can provide.

  • Comment on newbie wants to install DBI for ActiveState

Replies are listed 'Best First'.
Re: newbie wants to install DBI for ActiveState
by shenme (Priest) on Sep 16, 2003 at 18:41 UTC
    I see a DBD-ODBC-1.06.zip at ActiveState's ZIP files for 5.8 directory.   What exactly (and where from) did you download as DBD-ODBC.zip ?

    And I'm confused on another point?   Why did you need to download anything manually?   You should have been able to say "ppm install DBD-ODBC" and PPM would have gone to the ActiveState site and grabbed the latest and installed it.   Is there some reason you are trying to install from ZIP files?

Re: newbie wants to install DBI for ActiveState
by jdtoronto (Prior) on Sep 16, 2003 at 19:48 UTC
    Anonymous Monk

    from the DOS command line you can either enter 'ppm' in its interactive mode by just typing 'ppm' and then do a search, like:

    search DBD
    then do an install:
    install DBD-ODBC

    Then you should have what you need. With Active State you do not need to download zip files and install them. You can use ppm to handle the process, find the latest version and then allow you to install.

    jdtoronto

      Both of your responses were correct. Thanks. Once I simply used ppm, I could install the DBD-ODBC module without incident. I can now access my database fine.

      However, when I execute the following code:

      #!/usr/bin/perl -w use DBI; my @drivers = DBI->available_drivers; die 'no drivers installed' unless @drivers; for my $driver (@drivers) { print "driver:\t$driver\n"; my @dsns = DBI->data_sources($driver); for my $dsn (@dsns) { print "dsn:\t$dsn\n"; } }

      I get the following output:

      C:\Perl\source>perl dbtest.pl driver: ExampleP dsn: dbi:ExampleP:dir=. driver: ODBC dsn: DBI:ODBC:MS Access Database dsn: DBI:ODBC:Excel Files dsn: DBI:ODBC:dBASE Files dsn: DBI:ODBC:Visual FoxPro Tables dsn: DBI:ODBC:Visual FoxPro Database dsn: DBI:ODBC:testdb driver: Proxy install_driver(Proxy) failed: Can't locate RPC/PlClient.pm in @INC (@I +NC contain s: C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/DBD/Proxy.pm li +ne 28. BEGIN failed--compilation aborted at C:/Perl/site/lib/DBD/Proxy.pm lin +e 28. Compilation failed in require at (eval 3) line 3. Perhaps a module that DBD::Proxy requires hasn't been fully installed at dbtest.pl line 10 C:\Perl\source>

      Any ideas on what's going on with the Proxy driver? Should I be concerned about this?

        If you don't need the DBD::Proxy driver then you shouldn't be concerned, but if you do you can just use ppm to install the RPC::PlClient package as well and solve the problem.


        We're not surrounded, we're in a target-rich environment!
        You are asking DBI what drivers it knows about.   You are then asking each driver what data sources it knows about.   But to ask each driver for that information, DBI has to load the module for each driver.   At that point you discovered that DBD::Proxy had some dependencies you hadn't installed yet.   As jasonk said, this isn't really a problem unless you _really_ wanted to use the Proxy driver.

        I added a couple lines to your code to skip trying to load module DBD::Proxy and ran the loops to completion:

        print "driver:\t$driver\n"; if( $driver eq 'Proxy' ) { print " skipping polling DSN's for Proxy driver.\n"; next; }
        The output (on my system) was:
        driver: CSV
        dsn:    DBI:CSV:f_dir=test1
        driver: Chart
        driver: ExampleP
        dsn:    dbi:ExampleP:dir=.
        driver: File
        dsn:    DBI:File:f_dir=test1
        driver: ODBC
        dsn:    DBI:ODBC:dBASE Files
        dsn:    DBI:ODBC:Excel Files
        dsn:    DBI:ODBC:MS Access Database
        driver: Proxy
          skipping polling DSN's for Proxy driver.
        driver: SQLite
        driver: mysql
        dsn:    DBI:mysql:mysql
        dsn:    DBI:mysql:mytest
        dsn:    DBI:mysql:test