Function DbInfo() Foundation
Sets or returns information about a work area (database object).
DbInfo( <nDefine>, [<xNewSetting>] ) --> xOldSetting
The return value of DbInfo() is the value for the setting specified by <nDefine> in the database object. If it is a changeable setting and <xNewSetting> was specified, the function returns the old value.
When a file is opened in a work area using the command USE or the function DbUseArea(), an instance of the current database engine (DBE) is automatically created. This is a database object (DBO) which manages the open file. The DBO also contains information about the file open in the work area (a DBO represents the work area).
The function DbInfo() allows the current value of settings to be read or new values assigned and is only valid for a work area in which a file is opened. If no file is open in the work area where DbInfo() is executed, a runtime error occurs. The available and changeable settings are dependent on the DBE from which produced the DBO. Use the following links to get more information about the configuration of the various DBEs:
No-SQL Database Engines:
Client/Server Database Engines:
// In the example, a database file is opened and then various
// #define constants are passed to DbInfo(). The return
// value of the function DbInfo() depends on the #define
// constant.
#include "DbfDbe.ch"
PROCEDURE Main
USE Customer ALIAS Cust
SET INDEX TO CustA, CustB, CustC
? DbInfo( DBO_ALIAS ) // result: Cust
? DbInfo( DBO_FILENAME ) // result:
// c:\xpp\samples\data\misc\customer.dbf
// file handles
? DbInfo( DBFDBO_DBFHANDLE ) // result: 8 (= DBF file)
? DbInfo( DBFDBO_DBTHANDLE ) // result: 9 (= DBT file)
// number of available orders
? DbInfo( DBO_ORDERS ) // result: 3
USE
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.