Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Convert MDB File To Txt File

by Anonymous Monk
on Apr 28, 2005 at 04:56 UTC ( #452217=perlquestion: print w/replies, xml ) Need Help??
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.

      Can you give Some Sample Coding.. It Would be very better to develop further.. Thanks You!!

        What have you tried so far?
        I don't think anyone is going to write your code without any effort from you

        "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://452217]
Approved by ghenry
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2017-03-25 14:48 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (311 votes). Check out past polls.