Converting MDB to CSV using OOo/LibO

This post explains the steps necessary to convert a Microsoft Access database file into CSV, using (or LibreOffice) Base.

  1. OOo can’t open an MDB file natively. You have to create a new ODB file that connects to the MDB file as a “remote” database. Just don’t try to move around the files.

  2. Copy the tables over into a different, native ODF database (ODB) file. This may sound arbitrary, but it’s necessary; otherwise, the next step would either be impossible or unbearable.

  3. Base doesn’t have an “export to CSV” menu entry. You have two options:

    • Run the following SQL command (Tools → SQL…).

      SELECT * INTO TEXT "filename_without_ext" FROM "TableName"

      This command only works on a native ODB because Access’s SQL engine doesn’t support the INTO TEXT construct.

      Note that this actually creates an external table in the database (if it doesn’t show up, reload the database). As a consequence, you can’t use the same name for the CSV file as an existing table.

    • Copy the table into Calc and export it to CSV. This would have been extremely slow if done from the non-native DB.

Credits to the people at an thread who figured this out.

Note: By commenting, you grant me permission to freely republish your comment.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.