|
<< Click to Display Table of Contents >> BDE programming in Delphi |
![]() ![]()
|
This step-by-step demonstration of Borland Database Engine (BDE) programming in Delphi uses BDE API functions to retrieve a field value from a table. Most of the time, use of BDE API functions in Delphi 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 Delphi, data access using the BDE is encapsulated in the objects of the Visual Component Library (VCL). Using the VCL, the Delphi 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 DBDEMOS alias.
The topics below describe the various aspects of the BDE program.
•Project setup This section covers the preparation of the Delphi 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 applications.