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

Hello Monks,

I need to convert .mdb file to .txt file.. Is there any module or any coding to do this???

Thank you,

Replies are listed 'Best First'.
Re: Convert MDB File To Txt File
by inman (Curate) on Apr 28, 2005 at 09:06 UTC
    There follows some old code that I had knocking around on my machine from a proof of concept.

    This code was from a risk management project where there was a concern that the content of Access databases could not be analysed by the risk management search tool. The idea was to locate and dump any MDB to an XML file which could then be indexed without having to know anything about the database schema.

    The code is probably well dodgy...

Re: Convert MDB File To Txt File
by jZed (Prior) on Apr 28, 2005 at 04:59 UTC
    Well, I think Access can export to CSV so that's the easiest. If you don't have access to Access, you use DBI with DBD::ODBC to read the .mdb and DBD::CSV to write out the .txt file.

      Let me know how do you convert without "Access"..


        You should take a look at MDB Tools.

        Not entirely without problems, it's reliable enough that I use it in an ongoing project that I have to keep an eye on anyway. You can backtick to the command line utilities or use a GUI thingy. Looks like something that would benefit from having a Perl module in front of it...


        I just discovered this one:, which is available on both windows and *nix, apparently has an experimental .mdb reader and it can write in many formats.

        Did you read the second sentence of my reply? It specifies what to do if you don't have Access. Did you follow the links in that second sentence? They go to the documentation for the modules that will help you do what you want. Did you read that documentation and get stuck? If so, tell us what part you're stuck on and we'll be glad to help. You also need to tell us what OS you are using since the specifics of the answer differ depending on whether you are on windows or not.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Convert MDB File To Txt File
by gube (Parson) on Apr 28, 2005 at 05:19 UTC

    You can use DBI module and also using DBD::ADO or DBD::ODBC you just pass the query and read the text and you write it to the text file is better.

    To know detail about connect database go to the link How to link Ms-access data's in perl