When recently tasked with rewriting an antiquated hotel reservation booking system, that uses paradox data, into C#, I was disappointed to find no free tools online that can import the paradox tables into SQL Server. Thus to save others the time and trouble of writing an application to do this, and hopefully save people from wasting their money on rip-off software, I have written one. Mine is, of course, free to use, abuse, modify… whatever you want, and comes with the full source code.
Running the application requires .Net Framework version 4.5. Editing it requires Visual Studio 2012, either a paid-for version or Visual Studio 2012 Express for Desktop. In order for the c# program to read paradox table files, you need to have the Borland Database Engine installed. I have shared the installer for it on my SkyDrive as well, since I struggled to find it.
The idea is of course to import the data into an intermediate database in SQL server; then design a proper relational database. You shouldn’t be using the imported data directly. The application is not the fastest it could be, as it tries to import every paradox table it finds in the directory, and validates every single field of every row, using null for any that are invalid. It will also use strings for a lot of data types (anything besides string, int and DateTime); feel free to modify the application’s source if you want to specify more data types in the created SQL tables. (The GenerateSqlCreateTableScript method. The source is not complicated. Any c# developer, even one with little experience, should be able to follow the source code and modify it, should they need to.)
First of all, I suggest making a local copy of the paradox data files. With the user of the paradox system logged out, copy all the tables (*.db) to a local directory. Take note of the paradox location where you copied the files.
In the directory where you copied the paradox files, create a subdirectory called LOCKFILES, then alter its security attributes in Windows. Give the NETWORK SERVICE user full control of the directory.
- If the BDE is not already installed, install it.
- Run the BDE Administrator tool. On my Windows 7 environment, it is installed at: “C:\Program Files\Borland\Common Files\BDE\BDEADMIN.EXE”.
- Expand Configuration –> Drivers –> Native –> PARADOX and change the NET DIR setting to the path of the LOCKFILES directory you created. For example, if the paradox files are in E:\Paradoxdb, the setting should be E:\Paradoxdb\LOCKFILES.
- On the menu, click the Object –> Apply menu item.
Using the Paradox2Sql application
- If you extract the Paradox2Sql.zip file, you can launch the executable from bin\Release\Paradox2Sql.exe. Alternatively, open the project in Visual Studio 2012 and run it in the debugger.
- Set the Paradox files location to the directory path where your paradox DB files are.
- Create an empty database in SQL Server, and set the SQL connection string to a valid connection string to your newly created database. (Obviously using a user that has permissions to create tables and insert data in the database, or just use sa.)
- Click the Import button.