Clipper 5.x – Drivers Guide
Chapter 5
DBFMDX Driver Installation and Usage
DBFMDX is the dBASE IV compatible RDD for Clipper. This driver provides (.dbf), (.dbt), and (.mdx) file format compatibility.
In This Chapter
This chapter explains how to install DBFMDX and how to use it in your applications. The following major topics are discussed:
. Overview of the DBFMDX RDD
. Installing DBFMDX Driver Files
. Linking the DBFMDX Driver
. Using the DBFMDX Driver
Overview of the DBFMDX RDD
The DBFMDX database driver provides dBASE IV compatibility, including access to (.dbf), (.mdx), and (.dbt) file formats. The driver also supports dBASE IV compatible file and record locking schemes, allowing shared access between Clipper and dBASE IV programs.
Installing DBFMDX Driver Files
The DBFMDX database driver is supplied as the file, DBFMDX.LIB.
The Clipper installation program installs this driver in the \CLIPPER5\LIB subdirectory on the drive that you specify, so you need not install the driver manually.
Linking the DBFMDX Database Driver
To link the DBFMDX database driver into an application program, you must specify DBFMDX.LIB to the linker in addition to your application object files (.OBJ).
1. To link with .RTLink using positional syntax:
C>RTLINK <appObjectList> ,,,DBFMDX
2. To link with .RTLink using freeformat syntax:
C>RTLINK FI <appObjectList> LIB DBFMDX
Note: These link commands all assume the LIB, OBJ, and PLL environment variables are set to the standard locations. They also assume that the Clipper programs were compiled without the /R option.
Using the DBFMDX Database Driver
To use (.mdx) files in a Clipper program:
1. Place REQUEST DBFMDX at the beginning of your application or at top of the first program file (.prg) that opens a database file using the DBFMDX driver.
2. Specify the VIA “DBFMDX” clause if you open the database file with the USE command.
-OR-
3. Specify “DBFMDX” for the <cDriver> argument if you open the database file with the DBUSEAREA() function.
-OR-
4. Use RDDSETDEFAULT(“DBFMDX”) to set the default driver to DBFMDX.
Except in the case of REQUEST, the RDD name must be a literal character string or a variable. In all cases it is important that the driver name be spelled correctly using uppercase letters.
Though the DBFMDX driver supports numbered indexes, you should avoid using them (e.g., in operations like SET ORDER and INDEXKEY()). In a multiple-index system you do not have the absolute control of the numeric position of an open index that you have in a single-index system. As you add, delete, and rebuild index TAGs, their numeric position may change. You should make all command references by name. For example:
SET ORDER TO [<nOrder> | [TAG <cOrderName>] [IN <xcOrderBagName>]]
Summary
In this chapter, you were given an overview of the features and benefits of the DBFMDX RDD. You also learned how to link this driver and how to use it in your applications.