BDE programming in C++Builder

<< Click to Display Table of Contents >>

Navigation:  Application development > Introduction to BDE programming > BDE Programming in C++Builder >

BDE programming in C++Builder

Previous pageReturn to chapter overviewNext page

This step-by-step demonstration of Borland Database Engine (BDE) programming in C++Builder uses BDE API functions to retrieve a field value from a table. Most of the time, use of BDE API functions in C++Builder applications will be limited to a call to a single function. For instance, an application might call the DbiPackTable function to pack a dBASE table and use no other BDE API functions.

In C++Builder, data access using the BDE is encapsulated in the objects of the Visual Component Library (VCL). Using the VCL, the C++Builder database programmer may never need to make direct calls to BDE API functions. The purpose of this demonstration is to impart an understanding of the BDE by writing programs using direct calls to these API functions.

The BDE code is contained in a single procedure. This procedure initializes the BDE, opens a database, opens a table, retrieves a record, extracts a single field value, closes the table and database, and exits the BDE. The procedure also displays the retrieved field value in the Caption property of a TLabel. This demonstration uses the sample Paradox table Customer.db, in the BCDEMOS alias.

The topics below describe the various aspects of the BDE program.

Project setup This section covers the preparation of the C++Builder project for using this example routine.

Basic procedure An overview of the basic steps required to create a simple application that retrieves a field from a table. From each step you can jump to a detailed description of the BDE API functoion (with code examples) or to the sample template program.

Template program A sample BDE program structure you can use as a convenient template for creating your own C++Builder applications.

 

hmtoggle_plus1Application Development