Function DbeBuild() Foundation
Assembles and loads a compound database engine (DBE) from loaded component DBEs.
DbeBuild( <cCompoundDBE> , ;
<cDataDBE> , ;
[<cOrderDBE>] , ;
[<cRelationDBE>] , ;
[<cDictionaryDBE>] ) --> lSuccess
When a compound DBE was generated from the specified component DBEs, the function returns the value .T. (true). Otherwise, it returns .F. (false).
The DBE function DbeBuild() generates a new, assembled database engine (compound DBE) from previously loaded DBEs (component DBEs). A compound DBE makes use of all the characteristics of the component DBEs. When DbeBuild() is successful, it also means that DbeSetDefault() has been called with the new DBE, meaning the newly formed DBE is the default used for file management. This is then used as the default for commands like USE (where the option VIA can be specified) and all functions which can optionally specify a database engine.
In Xbase++ database engines can be assembled from up to four different components to build a database model. These individual components are the DATA, ORDER, RELATION and DICTIONARY components. A component is represented by a database engine (component DBE) which is contained in a DLL file and must be loaded into main memory using the function DbeLoad() before calling the function DbeBuild(). The function DbeBuild() creates a compound DBE from the specified component DBEs.
The number of component DBEs required for the definition of a database model varies depending on the database model. For the Xbase database model as defined by Clipper, the DATA component (DBFDBE) and the ORDER component (NTXDBE) are sufficient. (See the chapter "The Xbase++ Database Engine" in the Xbase++ documentation).
// In the example, a compound DBE is created from two
// component DBEs suitable for managing records
// and indexes in the DBFCDX database model.
PROCEDURE DbeSys
IF ! DbeLoad( "DBFDBE", .T.) // load engine for DBF files
ALERT( "Database Engine DBFDBE not loaded" , {"OK"} )
ENDIF
IF ! DbeLoad( "CDXDBE" , .T.) // load engine for CDX files
ALERT( "Database Engine CDXDBE not loaded" , {"OK"} )
ENDIF
// assemble engines for data
// record and index management
IF ! DbeBuild( "DBFCDX", "DBFDBE", "CDXDBE" )
ALERT( "Database Engine DBFCDX not created" , {"OK"} )
ENDIF
RETURN
// In this example, a DBE is generated for files in the
// SDF format. The SDFNTX DBE is generated with DbeBuild()
// from the NTXDBE and the SDFDBE as components.
// The program assumes that NTXDBE is loaded.
PROCEDURE Main
LOCAL aStruct
IF ! DbeLoad( "SDFDBE", .T. ) // load SDFDBE "hidden"
ALERT( "SDFDBE not loaded" , {"OK"} )
ENDIF
// create compound DBE
DbeBuild( "SDFNTX", "SDFDBE", "NTXDBE" )
USE Address VIA Dbfntx // open DBF file
COPY TO Address.txt SDF // create SDF file
DbeSetDefault( "SDFNTX" )
USE Address.txt // open SDF file
// (ASCII file)
INDEX ON Upper(LastName+FirstName) TO Address.ntx
// index ASCII file
Browse()
CLOSE Address
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.