![xdbdata2 | Embarcadero RAD Studio Delphi C++Builder Blogs X DBData Components](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/xdbdata2-2546404.png?resize=1140%2C675&ssl=1)
X-DBData is a VCL and FMX nonvisual component package that helps users bridge between Delphi’s data-aware and non-data-aware components.
There are two paradigms within the Delphi IDE.
Feature | Non-Data-Aware Edit Components | Data-Aware Edit Components |
Data Manipulation | Manual – using .Text, .Caption, .Value properties | Automatic field-linking via Field and DataSource properties |
Data Refresh | Manual – data has to be updated via code | Automatic update via Dataset Paradigm |
Data Type | Manual – certain data-types conversion (e.g., using TEdit to load and save Date type) | Automatic – Data-type is preserved if the correct Data-Aware TEdit is used. (e.g., using Data-Aware version of TDatePicker) |
Advantages | Allows complete control of the UI via coding. | Development time significantly reduced. Viable low-code solution. Exponentially reduce the amount of code required for database-transaction processing |
Disadvantages | Inability to use TDBGrid. Tedious and time-consuming to code UI to link UI to database | Require data source (e.g., database) to have TDataSet components available. |
Non-Database Business Solutions
X-DBData solves niche problems where your Delphi application is required to process large amounts of data.
Examples are:
- Processing instrumentation data (vehicle license plate detection logging)
- Input from nonconventional data sources (bank statements, OFX) and using non-Delphi databases (QuickBooks, Xero)
- Tamper-proof data-storage for which ease of data recovery is required (point-of-sale systems, portable health devices)
Using data-aware database components can dramatically reduce the amount of code for database-transaction processing.
X-DBData allows Delphi objects, such as TList, TObjectList, and generics to be used as a TDataSet replacement, without requiring a primary key.
Delphi generics can encapsulate certain kinds of data for which it is difficult to force a primary key, such as hierarchical data (files and folder), time-series data (stocks), and web-based state machine data (Vue, react states).
Getting Started
In the below-mentioned video, you can see it takes less than a minute to install X-DBData.
https://www.youtube.com/watch?v=_BcyQf2fnPE
Step 1. Select Tools > GetIt Package Manager, as seen below
![getit13608431 | Embarcadero RAD Studio Delphi C++Builder Blogs Get IT Menu](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/getit1-3608431.png?resize=601%2C435&ssl=1)
Step 2. When the GetIt Package Manager Window appears (shown below).
1. type in “x-dbdata”.
2. Click on the Install Button.
![getit21692105 | Embarcadero RAD Studio Delphi C++Builder Blogs getit2 1692105](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/getit2-1692105.png?resize=750%2C442&ssl=1)
Step 3. After installation, go to the Component Palette. Scroll to the bottom, where you should see OnGuard, with all the registered components.
1. Palette with X-DBData components.
![getit34287607 | Embarcadero RAD Studio Delphi C++Builder Blogs getit3 4287607](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/getit3-4287607.png?resize=750%2C393&ssl=1)
QIF Editor Recipe
In this below example, I use X-DBData to quickly read Quicken Interchange Format (QIF), exported from a bank website, or from QuickBooks On-Line.
A sample custom data-aware integration would take ~5 minutes to integrate.
The QIF data structure takes a list of QIF transaction data and, using X-DBData, changes it from a list of QIF data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
... uses System.Generics.Collections, SysUtils; type TTransaction = class(TObject) private fdate: TDateTime; fdebit: currency; fcredit: currency; ftype: string; ftransaction: string; fcomment: string; public property EntryDate: TDateTime read fdate write fdate; property EntryDebit: currency read fdebit write fdebit; property EntryCredit: currency read fcredit write fcredit; property EntryType: string read ftype write ftype; property EntryTrans: string read ftransaction write ftransaction; property EntryComment: string read fcomment write fcomment; end; TTransactionList = class(TObjectList<TTransaction>) public end; implementation end. |
The QIF editor allows a user to edit transactions, create or delete transactions, load from CSV (Excel), and export to CSV (Excel).
![20210216943078488779 | Embarcadero RAD Studio Delphi C++Builder Blogs 2021 02 16 9 43 07 8488779](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/2021-02-16_9-43-07-8488779.png?resize=750%2C338&ssl=1)
The QIF data is loaded into TTransactionList and into TXDBData:
1 2 3 4 5 6 7 8 9 |
procedure TFrmQIFEditor.dbListInsertRecord(DataSet: TDataSet; Index: Integer); begin atl.Insert(Index, TTransaction.Create); end; procedure TFrmQIFEditor.dbListDeleteRecord(DataSet: TDataSet; Index: Integer); begin atl.Delete(Index); end; |
The resulting QIF file saved from QIF Editor is then uploaded to QuickBooks Online or Xero.
Note: I used the full version of X-DBData while developing QIF editor. I have shipped several products (with full-source code) using X-DBData.
The source-code of QIF editor is found at https://github.com/PolywickStudio/X-DBDataRecipe
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition