Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

FireDAC & ODBC for Paradox and dBase tables.

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.
            
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):

Using sample Paradox file from samples: C:UsersPublicDocumentsEmbarcaderoStudio19.0SamplesData

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

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:UsersPublicDocumentsEmbarcaderoStudio19.0SamplesData

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

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

 

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

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

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

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

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

 

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!

[DownloadButton Product=’RAD’ Caption=’Try FireDAC and the FireDAC ODBC bridge driver on your own Paradox and/or dBase file today using RAD Studio 10.2 Tokyo’]

Exit mobile version