Databases - Borland Database Engine (BDE)

The Borland Database Engine (BDE) is provided with those Borland and Corel products that provide database access, including Paradox, dBase, Delphi, C++ Builder, and Quatro Pro. It provides a non-Microsoft way to access data in Paradox, DBase, FoxPro, and ASCII databases. It also provides an ODBC connection to other types of databases.

After the BDE is installed, it must be configured - normally using the BDE Administrator - to define the aliases that are used to specify the databases. (ODBC, ADO, and the like also require similar configuration.) (An API allows configuration to be made programatically.)

In general, when I write programs, I currently use ADO to perform this function because its functionality is built into the current MS Windows operating systems, and, therefore, I don't have to worry about installing the BDE for my applications to work.

BDE Administrator | Paradox Databases | MS Access Databases | FoxPro Databases | Firebird Databases


BDE Administrator

There are several ways to run the BDE administrator

A yellow-green box around an icon means that the connection is working (open) and that you can get data about the tables and fields in that database.

A green arrow means that the alias definition has been edited but is not yet saved (applied).

Parameters with bold letters can not be changed.


Adding a new alias

The purpose of the BDE administrator is to add and configure alias definitions. To add a new alias For Paradox, DBase, FoxPro, or ASCII databases, select Standard and set the Default Driver to one of the following Once a new alias is added via the control panel, you need to close and re-open Delphi in order to see it via Database / Explore.

Borland provides sample Paradox, dBase, and Interbase/Firebird databases under

When connecting to these over a network, and when the fileserver is NT, 2000, or XP, you will probably have to add Write and Change (or Modify) to the default directory permissions for Everyone.


Paradox Databases

A Paradox database is a directory - tables are stored as one or more files within the directory.

To create a new alias, follow the instructions above, select the Standard driver, and set the following parameters.


PDOXUSRS.NET

Paradox tables are generally locked on a "per record" basis. This is managed by having all Paradox lock requests written to a single "Lock file" (one per database/directory). These lock files contain a pointer to the directory containing PDOXUSRS.NET. In order for this to work, each machine must access PDOXUSRS.NET using the exact same drive letter and path. If the drive letter is "p" on one machine, then it must be "p" for every machine on the network.

Typically, PDOXUSRS.NET and the databases are all on the database server, but in different directories. However, they do not have to be on the same machine. When several database servers are used, one of them is normally selected for PDOXUSRS.NET and none of the databases can be used if that server is off-line.

Locking problems are usually caused by misconfiguring one of these. If these rules are not followed, then there are severe locking problems.

In English, what this means is that every system on the network must have the drive containing the database mapped to the same drive letter. If one system has the database mapped to drive-p, then every computer with access to that database must also have it mapped to drive-p. In addition, the path to the lock file must be the same on all the machines

You must be sure that the computer that actually hosts the database does not use a local drive letter (such as the c-drive). If the database is accessed via p:/myTables on one machine, it must use the same path on all the machines.


Setting the PDOXUSRS.NET file path

Open the BDE Administrator via the Control Panel (this can't be set if you open it via Delphi). Click the Configuration tab and set to the location of PDOXUSRS.NET.

Notice that PDOXUSRS.NET is not associated with a specific database. When there is more than one Paradox database, then they all share the single PDOXUSRS.NET file.


MS Access Databases

MS Access databases are stored as *.mdb files - all the tables are stored in that file.

With MS Access tables, the BDE implies that you have access to 5 internal MSys* tables, however, only MSysAccessObjects can actually be read. (I don't suggest modifying this ... just look.)

The BDE provides an MS Access interface, or you can select the appropriate ODBC driver.

To create a new alias using the BDE driver, follow the instructions above, select the MSACCESS driver, and set the following parameter.

My copy of Delphi 5 came with BDE administrator 5.01. I tried updating the BDE to version 5.2, but I still could not read MS Access 2000 files when MSACCESS was selected. Therefore, I suggest using an ODBC connection if you need to read one.

To create a new alias using the ODBC driver, follow the instructions above, select the appropriate ODBC driver ("Microsoft Access Driver (*.mdb)" on my system), and set one of the following parameters.

The MS Access lock file is generally created in the same directory as the *.mdb file. This is why you need to open an MS Access database as readonly and exclusive when it is located on a CD ROM (this keeps the system from trying to create it on a readonly disk).


FoxPro Databases

A FoxPro database is a directory - tables are stored as one or more files within the directory.

To create a new alias, follow the instructions above, select the Standard driver, and set the following parameters.


Firebird/Interbase Databases

A Firebird database is a single file - normally either *.fdb or *.gdb - all the tables are stored in that file.

To create a new alias, follow the instructions above, select the INTRBASE driver, and set the following parameters.

Warning: If the focus is in an Opened Interbase/Firebird table when Object / New... is selected, it is possible that you will create a new table or a new field instead of a new alias.

To connect to a remote firebird server, you MUST include the drive letter after the computer name.

The Interbase help says that the following format is also acceptable in ISQL - but it definitely does NOT work in the Database Explore.

Firebird is the open source version of Borland's Interbase database server.


ODBC Connection

Though I don't recommend it, Firbird databases can be accessed via ODBC.

Under Control Panel / ODBC (the exact path is OS dependent), create a System DSN alias based on INTERSOLV Interbase ODBC Driver (*.gdb). The Data Source Name is the ODBC alias name that you create. In order to use the sample database on a remote server, set Database Name to

In the BDE Administrator, add a new BDE alias using the INTERSOLV InterBase ODBC Driver and enter the new ODBC alias name in ODBC DSN.

The ODBC Data Source Administrator is also available from the Database Explorer menu via Object / ODBC Administrator...


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Databases / BDE.html