Reading Paradox Files

Back in the day, Paradox was a pretty amazing database.  I recently had a reason to read some Paradox files for a friend, who had a client with a Paradox database.  They needed their data out of the database to insert into something more modern.

Googling for the file format of a Paradox DB didn’t turn up much, other than this excellent document written in 1996.  It was enough to give me a good start.  I also found some sample DB files, interestingly from the Paradox documentation.

The end result was paradoxReader, which you can download here.  It handles most of the data types other than BLOBs, so far.  The documentation on how to use it is here.  It uses the visitor pattern, which means all you need to do is pass it an InputStream to a .db file, and implement a single interface which is called once per row, with the row data.

The default implementation currently outputs CSV for each table, however it wouldn’t be difficult to have it output SQL or even just connect to a JDBC database and insert the data into a table.

Similar Posts

  • Outlook for Mac Archives

    I recently had a reason to parse a large data set, for another project.  I decided that an ideal “large data set” would be my Outlook mail saved archives.  Sadly, Outlook for Mac doesn’t output PST files, it outputs OLM archives, which are, essentially, giant zip files full of XML.  I was coding this all…

  • |

    Embedding Jasper

    Jasper is the JSP compiler inside Tomcat. For reasons, mainly of curiosity, I wanted to build a Pragmatach plugin which exposes Jasper.  Pragmatach supports some template engines such as FreeMarker, ThymeLeaf and Velocity, but I thought Jasper would be a good addition. I chose to use Tomcat 6, mainly because Tomcat 7 uses Servlet 3.0.  Pragmatach…

  • Ebean-DAO

    When building database ORM code, I prefer to use ebean, and I prefer to use DAO‘s. Since DAO’s are simple to make generic, I have a Generic DAO I use for all projects. I’ve finally decided to open-source my DAO code, and you can find it here https://github.com/teverett/ebean-dao.

  • DOT4J

    I’ve recently been quite interested in Graph languages, not for Graph Databases, but for representing information, in code that is essentially “things” and “relationships”. For example, one perspective on Organizations is that they are simply representable as people, systems and the information that flows between them. Those three building blocks are, in theory, enough to…

4 Comments

  1. Hi,

    This is great!
    I recive a Exception:
    Caused by: java.lang.Exception: Unknown field type ‘4’
    at com.khubla.pdxreader.db.DBTableField.readFieldTypeAndSize(DBTableField.java:119)
    … 5 more

    I can see that FieldType 4 is missing. Do you know whay you fiealdType 4 is not implemented?

    BR
    Mats Ahlbom

    1. Hi!

      I also use this great library to read old paradox db files and faced the same problem. But I’ve fixed this with little patch of the lib. Unknown field type ‘4’ is an integer type, there is also type ’21’ missing for timestamp fields.

      I supported two new FieldType enum values and their handling in DBTableValue and that’s worked.

  2. Hi,
    I am getting a block size error (16) with some of the DB files I try to process. Just in case someone ran into the same issue and has a solution.
    Tom, I sent you an email with a sample.
    Thanks,
    Marc

Leave a Reply

Your email address will not be published. Required fields are marked *

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