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

Hi monks,
Is it possible to connect msaccess database file thru perl version 5.6 using the apache server for CGI?.
If possible can you please explain What are the modules need to be installed for perl to access the database thru server? and
where to put the database file either in apache server or
Can i put it in to the apache server local "C:\main.db" Drive.
is any configuration SETUP can be made for this database access by apache?.
Pls guide me.
Thanks in advance for your suggestions
  • Comment on connecting MSACCESS DB thru PERL using APACHE SERVER?

Replies are listed 'Best First'.
Re: connecting MSACCESS DB thru PERL using APACHE SERVER?
by holli (Abbot) on Jun 01, 2005 at 08:23 UTC
    You can use the native driver DBD::ADO, or DBD::ODBC. You will also need the Microsoft Data Access Components (MDAC).


    holli, /regexed monk/
Re: connecting MSACCESS DB thru PERL using APACHE SERVER?
by tchatzi (Acolyte) on Jun 01, 2005 at 09:13 UTC
    First of all Apache has nothing to do with msaccess if you want to have a script that access a db written in perl.
    The only thing you need is a perl module with which you will make your script communicate with your database.
    Apache does not need to know what kind of db's you use.
    The only thing that will do is to triger the perl interpreter to execute the cgi of yours.
    So your question should be
    'how can i make a perl script communicate with ms access and make queries with it? '

    ``The wise man doesn't give the right answers, he poses the right questions.'' TIMTOWTDI
Re: connecting MSACCESS DB thru PERL using APACHE SERVER?
by eric256 (Parson) on Jun 01, 2005 at 14:31 UTC

    Another aproach would be to switch your database backend. This isn't as bad an answer as you might think, though it isn't always an option. I have had great success in moving the data out of MS Access into MySQL tables using the export wizard that comes with Access. Then you can still use Access for forms and reports, but your data sits in an easily available MySQL server. I've found that if you link to the MySQL tables inside your db file then even 3rd party applications that use the db file will now be using your MySQL backend without even knowing it. In many cases this can provide a great speed boost with minor work. Just my 2 cents.


    ___________
    Eric Hodges
Re: connecting MSACCESS DB thru PERL using APACHE SERVER?
by monarch (Priest) on Jun 01, 2005 at 08:04 UTC
    There does not appear to be a lot of support for direct access into .mdb files.

    However may I suggest you look at http://mdbtools.sourceforge.net/, there may be some functionality that can assist.

    Update: Hmm I've been down modded already for this answer, which is curious. Yes there is tons of ODBC support for Access however the author of this question never suggested he had Access actually running.. I was under the impression he wanted a means of getting into a .mdb file directly..

      Er, you don't need Access actually running to use the ODBC driver which itself goes directly to the .mdb file. The mdbtools also are trying to provide some degree of support for ODBC access on Unix.

      /J\

        Ah I see.. good answer.. I've learnt something today then.. that ODBC drivers can read .mdb files with Access!

        Very useful tip. Thanks!