Function DbeInfo() Foundation

Sets or returns the settings of a database engine.

Syntax
DbeInfo() --> aComponentNames
or
DbeInfo( <nComponent>, <nDefine>, [<xNewSetting>] ) --> xOldSetting
Parameters
<nComponent>
<nComponent> must be a #define constant from the file DMLB.CH. It selects the component of a DBE whose settings are to be set or returned:
Constants for selecting a DBE-component
Constant Component
COMPONENT_DATA DATA component
COMPONENT_ORDER ORDER component
COMPONENT_RELATION RELATION component
COMPONENT_DICTIONARY DICTIONARY component
<nDefine>
The parameter <nDefine> must be a #define constant from an #include file. The file DMLB.CH contains generic constants for use with any database engine. These constants must begin with the prefix DBE_. There are also constants specific to certain database engines. For the DBFDBE, the constants are contained in the DBFDBE.CH and begin with the prefix DBFDBE_.
<xNewSetting>
If <nDefine> is a changeable setting of the database engine, the setting specified by <nDefine> is replaced by the value <xNewSetting>.
Return

If DbeInfo() is called without parameters, the function returns a one dimensional array of character strings identifying the names of the individual DBE components. If a particular component is not supported the corresponding array element contains NIL.

Otherwise, the return value of DbeInfo() is the value for the setting within a component DBE specified by <nDefine>. If it is a changeable setting and <xNewSetting> was specified, the function returns the old value.

Description

The function DbeInfo() allows reading or changing the settings of the default database engine (DBE). Function DbeSetDefault() is used to define the default or current DBE. The affected settings depend on the current DBE or on the file format managed by the DBE. The DBFDBE allows settings as to whether records are automatically locked during concurrent write access, or whether they must be explicitly locked using RLock() or DbRLock(). When using the DELDBE (COPY TO...DELIMITED), the delimiting characters can be specified for a record as well as for fields and character strings. When using the SDFDBE (COPY TO...SDF) whether a point or a comma-separates the decimal places in numeric values can be specified.

The function DbeInfo() allows settings of a DBE to be read and changes to be made in the configuration of a DBE by specifying <xNewSetting>. When a DBE is configured, the values are valid for each work area in which a file is later opened using this DBE. When a file is opened in a work area, an instance of the DBE is created. This is a called a database object (DBO) and manages the file open in the work area until it is closed. The DBO "inherits" the current configuration of the DBE. If the DBE is reconfigured after the opening of a file in the work area, these changes are not valid for the files already opened. Use the following table to get more information about the configuration of the various DBEs:

ASCII File Database Engine (SDF/TXT):

- DELDBE

- SDFDBE

No-SQL Database Engines:

- DBFDBE

- FOXDBE

- NTXDBE

- CDXDBE

Client/Server Database Engines:

- PGDBE

- ADSDBE

- ODBCDBE

To read or change settings for a work area (to configure a database object), the function DbInfo() must be used.

Examples
Turn on automatic record locking

// The example demonstrates the call of DbeInfo() 
// to turn automatic record locking on for the 
// compound DBE "DBFNTX". Then the names of the two 
// component DBEs are also read. 

#include "DbfDbe.ch" 

PROCEDURE Main 

   ? DbeSetDefault()                       // result: DBFNTX 

   DbeInfo( COMPONENT_DATA, ;              // automatic 
            DBFDBE_LOCKMODE, ;             // record lock for 
            DBF_AUTOLOCK )                 // database files 

   ? DbeInfo( COMPONENT_DATA,  DBE_NAME )  // result: DBFDBE 
   ? DbeInfo( COMPONENT_ORDER, DBE_NAME )  // result: NTXDBE 

RETURN 
Feedback

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.