Turbo C++ / C++Builder Database Development
Right after Turbo C++ was released, I published a free courseware manual on Turbo C++ / C++Builder Database Development, which can now be downloaded in PDF format.
Topics include BDE, dbGo for ADO, the ClientDataSet and dbExpress.
- Database Development
In this section, I'll introduce the data model for the courseware manual on data access technologies available in Turbo C++ and C++Builder (also described in some detail here).
- Data Access Technologies
CD/DVD Data Model
- Summary
- The Borland Database Engine
In this section, I'll cover the Borland Database Engine and the data access as well as data aware controls that can be used with C++Builder.
We'll see how to define persistent fields, lookup fields and calculated fields, and how to create dynamic tables using C++ code.
- Local Tables
Example DVD Application
Creating Tables using Database Desktop
Creating Tables in C++
r BDE Data Access
TTable
TQuery
- BDE Example Application
Data Module
Creating Tables for Data Module
- Data-Aware Controls
Persistent Fields
Fields Editor
Lookup Fields
Calculated Fields
- Summary
- dbGo for ADO
In this section, I'll cover the dbGo for ADO data access technology by migrating the data from Paradox to SQL Server, and the BDE data module to an dbGo for ADO data module.
We'll also see how to use Stored Procedures, a feature only available in a real DBMS like Microsoft SQL Server / MSDE (and not in local BDE Paradox or dBASE tables).
- dbGo for ADO
TADOConnection
TADOTable
TADOQuery
TADODataSet
- Migration to ADO
SQL Server / MSDE
ADO Connection
Migrating Data
Migrating Data Module
Stored Procedures
- Summary
- TClientDataSet
In this section, I'll migrate the SQL Server data to the TClientDataSet MyBase local table format.
We'll see how we can mimic the behaviour of queries by using the TClientDataSet's Filter property, and experimented with the data and delta (changes) of the TClientDataSets.
Finally, we'll add the ability to actually borrow DVDs in our example application.
- Standalone TClientDataSet
Migrating Data
No Queries!?
New Data Module
Adding Lookup Field
Adding Calculated Field
Updates and Undo
Connecting the GUI
Borrow DVDs
Local XML Files
- Summary
- dbExpress
In this section, I'll migrate the DVDs from the local MyBase format back into the SQL Server / MSDE database.
We then migrate the data modules to a disconnected model using dbExpress, and learned that a dbExpress dataset is unidirectional and read-only, meaning we have to use a TDataSetProvider and TClientDataSet in combination with a dbExpress dataset in order to be able to navigate and work with (modify) the data.
- Disconnected Data
dbExpress Components
- Migrating to dbExpress
Migrating DVDs
CommandText Problem
Read-Only & Unidirectional
TClientDataSet to the Rescue
- CDS to DBX
ApplyUpdates and MaxErrors
ChangeCount and Undo
dbExpress Data Module
- Additional Fields
Connecting the GUI
Save Changes
Update after Post / Delete
Update on Request
Enabled Undo
Borrow DataSet
Who's Got It?
- Summary
The contents of this Turbo C++ / C++Builder 2006 Database Development courseware manual is based on my articles about C++Builder 6 and Database Development that were published in the C++Builder Developer’s Journal in 2005. I’ve migrated the articles to C++Builder 2006 and Turbo C++ by retaking all screenshots and verifying the code and steps against the new version of the C++Builder IDE.
The free version of this Turbo C++ / C++Builder Database Development courseware manual is distributed in a PDF format that can only be read on a computer screen, and cannot be printed (nor can you select and copy text or code snippets from the document).
For 15 Euro or 21 US$ you can get a personal version of the PDF file that can be printed, including full source code with projects for C++Builder 2006 (the free version of the manual contains more details).