Delphi Clinic | C++Builder Gate | Training & Consultancy | Delphi Notes Weblog | Dr.Bob's Webshop |
![]() |
![]() |
![]() |
|
Database Development with C++Builder
Most people may know me from my Delphi related articles, but apart from writing about Delphi (on Windows, Linux or .NET), I also use, support and write about C++Builder.
In fact, I was co-author of the C++Builder Developer's Guide books, and I've written a few dozen articles for the C++Builder Developer's Journal over the years.
Last month, I proposed to Damon Chandler (editor of the C++Builder Developer's Journal) to start a new series covering database related technologies that are supported in C++Builder.
Like many of our readers, I think this is an important topic, especially since some of the data access technologies currently available in C++Builder might be on the brink of being deprecated (like SQL Links) or frozen (like the BDE and ADO), and with the .NET Framework looming on the horizon.
Introduction
In this first article, I will only give a brief introduction, list all available data access technologies that are available in C++Builder.
As of next month, I'll follow up with one article per "technology", working with similar data, showing similar techniques (how to work with a single table, do master-details, queries, queries with parameters, use lookup tables, insert/add records, edit/post, and delete records, etc.), which databases can be used, and what it takes to deploy the resulting application.
The data access technologies that are present in C++Builder and will be covered in the following months, are the following:
CD/DVD Data Model
The answer is: my CD/DVD collection database.
It contains enough fields and tables to make it worthwhile, and is in fact a real-world application (for all my family members who want to borrow DVDs - and for me keeping track of who has borrowed what, and since when).
The first design of the CD/DVD collection database consists of four tables:
CD / DVD | |
Field | Type |
CdDvdID | Integer (key) |
CategoryID | Integer (foreign key) |
Name | String |
Description | String |
Category (lookup table) | |
Field | Type |
CategoryID | Integer (key) |
Name | String |
Friend | |
Field | Type |
FriendID | Integer (key) |
Name | String |
Description | String |
Contact (e-mail, MSN, phone, etc.) | String |
Borrow | |
Field | Type |
CDDVDID | Integer (key) |
FriendID | Integer (foreign key) |
SinceDate | Date |
Summary
In this article, I have introduced the data model for a series of articles in the C++Builder Developer's Journal on data access technologies found in C++Builder.
Epilogue: Borland Database Engine (BDE)
In the March 2005 issue, I've covered the Borland Database Engine, using Paradox files to implement the data model in four physical tables.
The screenshot below shows the data module that I ended up with:
The data module contains three tables and two queries (with parameters, I must add).
The article shows how to define lookup fields as well as calculated fields, and how to add parameter values to the queries.
The final result is a first GUI application using the Borland Database Engine to work with data from four tables (still almost empty in the screenshot below):
The full article can be read in the C++Builder Developer's Journal, just like the follow-up articles. I might also publish one or more of them on this website after a few months (like the ones using dbExpress or DataSnap).
In the meantime, I've filled the CD / DVD table with a few hundred DVDs.
Just in time to move on to ADO and an ADO database (like SQL Server MSDE or Access) in April, followed by an issue in May where we’ll examine the stand-alone TClientDataSet as alternative.
In the June issue of the C++Builder Developer's Journal, I’ll cover dbExpress- the cross-platform data access technologies that was branded as the replacement for SQL Links.
And finally in July and perhaps also August we’ll extend all this to the multi-tier world, adding DataSnap to the mix (which can use any of the previously covered data access technologies as basis).
If you have questions or feedback, feel free to use the C++Builder Developer's Journal Forum or contact me directly.
Hope to see you next time!