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

Greetings, I have been trying to use Perl to access a Microsoft Access database. To do this I have been trying to use the DBI module. Thus far, I have not been able to use the DBI module. When I try to run the code I get three errors. OOne is telling me I can't use DBI in my code. The other two are errors in DBI.pm itself saying that it cant find a loadable object and that the compilation of DBI.pm was aborted. This leads me to believe that I havent installed DBI for the Mac correctly. To make sure I am doing this right, could someone please give me a step by step guide to installing this module on a mac? Thank you Donesh

Replies are listed 'Best First'.
Re: Building and Using Modules on a Mac
by Coyote (Deacon) on May 29, 2001 at 20:59 UTC
    I think you are out of luck in regard to accessing an MS Access database from the Mac, however you can get a precompiled version of the DBI modules for the Mac at http://pudge.net/cgi-bin/mmp.plx. The last time I checked, you could only use DBD::Proxy and possibly DBD::CSV with on the Mac. In order to manipulate MS Access databases, you will need DBD::ODBC and an ODBC driver. I don't believe either is available under the MacOS.

    If you are feeling adventurous and have a a networked PC lying around, you could set up a proxy server on the PC and connect to it from the Mac. There is an article on setting up DBI::Proxy for use with Sybase and a mac at http://pudge.net/macperl/dbi-dbd-proxy.html.

    Your best bet in this case would be to export the data into a format that the Mac handles a little better such as CSV (check out Text::xSV for an elegant, pure perl CSV module) or even MS Excel.

    ----
    Coyote

      I can't say for sure whether there is a DBI module to talk to it, but ODBC for the Macintosh does exist, and is installed with Microsoft Office 98 and 2001 (I am unfamiliar with previous versions).

      Also, if you upgrade to OS X, you aren't limited to MacPerl.

        Just to clarify my point a bit, MS ships ODBC with MS Office on the Mac and includes a driver for Excel. You can also get drivers for Fox Pro and FileMaker, however MS claims (via email) that "no odbc driver exists for Access on the Macintosh and we have no plans to develop drivers on this platform." or something along those lines. This was back in October of 2000, so things may have changed.

        Also, upgrading to OSX won't help in this case (getting data out of an Access *.MDB file) since you are still dependent on Microsoft to create a method of accessing their proprietary database format. OSX will give the option to use MySQL or PostgreSQL.

        ----
        Coyote

Re: Building and Using Modules on a Mac
by Anonymous Monk on May 29, 2001 at 23:02 UTC
    Thank you, Donesh