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

  • MusicBrainzTagger

    I’ve tried a couple different mp3 taggers to tag my mp3 library, however, most seem to have trouble with large mp3 libraries.  So, after doing some reading about AcoustID and MusicBrainz I decided to quickly code up my own tagger, MusicBrainzTagger. MusicBrainzTagger is a command-line application which recurses a directory of mp3 files and tags…

  • Apache Commons Math

    Commons Math is an Apache library which includes a variety of mathematical tools, including 1st and 2nd-order ODE solvers.  In order to familiarize myself with the ODE solvers, I wrote a simple program to solve an RC charging circuit. The circuit has these parameters: R (ohms), the resistance of the resistor C (farads), the capacitance…

  • Playing with the Spa

    We have an Arctic Spa at our house which we enjoy. Recently, an OpenAPI spec has been published for it, so I decided to write a Java wrapper so I could control the spa myself, and monitor temperature with Prometheus and Grafana. The resulting code is here. The wrapper class “com.khubla.kspa.Spa” takes care of all…

  • Quadrigacx API

    I’ve recently become very interested in blockchain, and that, naturally led me to Ethereum and Bitcoin.  From there, I got a little interested in online trading, but since I prefer not to have to think about trading, I started thinking about a trading bot.  Part of the work I needed to do was write a…

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.