C++Builder - ClientDataSet, part 1
Database programming with C++ Builder Starter
The TClientDataSet is a component that holds data in an in-memory table. In the past, it was only available in the more expensive editions of C++ Builder. Now, however, it is also available in the free Starter edition. So, contrary to popular belief, the Starter edition does have some database components, such as TClientDataSet, TDataSource, TDBGrid, TDBEdit, and more.
You can navigate, index, search, filter, and edit the data held in memory. Because these operations are performed on data stored in memory, they are blazingly fast. For example, on a simple PC an index was built on a table with 100,000 records containing random strings of 20 characters... in less than half a second! Once built, this index can be used to perform near instantaneous searches.
A database is an organized collection of information, contained in tables.
A table contains records, and each record contains fields.
Post a record means: write the data to the database.
In this series of tutorials, we will build a flat database for maintaining the stock of articles for a furniture shop.
Setup of the database
We shall store the data in a TClientDataSet, named cdsArt.
Compilation and test
Setting up the database in this way is quite easy and almost includes no code writing.
But when you play with the program, you'll note the following serious limitations:
We'll improve on all of this in the next parts of our tutorial.
About the author
Industrial Engineer Guido Festra worked as a profesionnal hardware- and software-instructor for various American computer companies (Varian Data Machines, Texas Instruments, Wang Computers and others). Nowadays, he develops custom software and websites for European companies.
Table of contents
1. Intro / Setup
2. Load / Save
4. Find / Filter
5. Report generator