FireDAC & ODBC for Paradox and dBase tables.

Posted by on in Blogs

I continue to get customer requests for options to migrate legacy RAD Studio, Delphi or C++ Builder applications using the Borland Database Engine (BDE) with Paradox and/or dBase files.

Paradox            dBaseDOS

With the current versions of RAD Studio, you can use the FireDAC ODBC bridge driver to get to Paradox and dBase tables.  This is important if you want to keep your legacy Paradox or dBase tables when you are migrating to newer versions of RAD Studio, Delphi or C++ Builder, or if you want to move off of Paradox or dBase to a SQL Relational Database, like Embarcadero’s InterBase database.

If your application connects to a database or works with data, then you really need to look at FireDAC. FireDAC is a fantastic data access framework that supports a large variety of databases and has incredible in-memory features as well. It is based on the model that the Borland Database Engine (BDE) established, but much more robust and lightweight.

FireDAC is Embarcadero’s new Data Access Library.  FireDAC is an amazing data access library!  Robust, bi-directional, all of the features we used to have with the BDE, but now it’s lightweight and fast and mush more powerful!

FireDAC includes in memory dataset, Client side SQL, pull datasets from different data sources, like REST, local database, remote database, text file, Excel spreadsheet, whatever the data source, into FireDAC, or from a 3rd party library, once you have done that, and you have all these datasets in memory, you can use FireDAC to execute a join across all these datasets!  And write local SQL against all these datasets!  This is all very useful and powerful!  

This post describes how to access Paradox and/or dBase tables using FireDAC and the FireDAC ODBC bridge driver.

How to use FireDAC and the FireDAC ODBC bridge driver for Paradox or dBase.

1. Create an ODBC connection using MS Windows Control Panel

Here I created an ODBC Data Source (32-bit) called Employee Paradox using the Driver do Microsoft Paradox (*.db):

ODBC_Paradox

Using sample Paradox file from samples: C:Users\Public\Documents\Embarcadero\Studio\19.0\Samples\Data

2.  Create the ODBC connection for employee.db paradox database:

ODBC_Paradox_Setup

3.  Using RAD Studio, Delphi or C++ Builder 10.2 Tokyo, create a New Multi-Device Application (Blank Application).

4. Drop TFDConnection on the form.  Double-click the TFDConnection to open the FireDAC Connection Editor:

5. Select ODBC as the Driver ID.  Set the Database property to the folder containing your Paradox files.  Here we are using the RAD Studio sample data folder:  C:Users\Public\Documents\Embarcadero\Studio\19.0\Samples\Data

ODBC_Driver_ID

 6. Select the ODBCDriver you are using, and the DataSource you created:

ODBCDriver

 7. On the Multi-Device Form add a FDTable component.

FDTable

 

8. Using the Object Inspector, set TableName property of FDTable to your Paradox table:

TableName

 9. Add a TStringGrid to your Multi-Device form:

StringGrid

10. Right click on the TString Grid and select Bind Visually...

11.  Using the LiveBindings Designer, bind the FDTable to the StringGrid:

LiveBindingsFDTable

12.  To see Design Time data on the StringGrid, using the Object Inspector for the TFDTable, set the Active proper = True.

 FDTableTrue

StringGridData

Congratulations!   This is how you can use FireDAC and the FireDAC ODBC bridge driver and keep your Paradox and/or dBase files with the newer versions of RAD Studio, Delphi and/or C++ Builder!



About
Gold User, Rank: 91, Points: 4
Al Mannarino has 25+ years of software development experience, including object-oriented analysis and design (OOAD) and developing and deploying production applications. He is currently a Principal Software Consultant and Evangelist for Embarcadero Technologies. Prior to joining Embarcadero, Al spent three years working with CodeGear, a division of Borland that was acquired by Embarcadero in 2008. He also worked for five years as a lead systems engineer for Borland supporting application lifecycle management, software delivery optimization and developer tools solutions. Prior to Borland, Al served as a systems engineer for companies including Objectivity, Versant, Red Brick Systems, Information Builders, and was an electrical engineer for Grumman Aerospace performing application implementations on complex electrical-mechanical systems. Al has a bachelor's of science degree in electrical engineering from Manhattan College.

Comments

  • Yilmaz Yoru
    Yilmaz Yoru Friday, 9 June 2017

    Wow Paradox DB is a very old DB but this is very nice to if some users wants to move to current databases like MYSQL, Oracle, MS Server, Interbase etc..

  • Please login first in order for you to submit comments
  • Page :
  • 1

Check out more tips and tricks in this development video: