Functions.DbInfo Method |  |
Return and optionally change information about a database file open in a work area.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.16
Syntax FUNCTION DbInfo(
kInfoType,
uNewSetting
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual DbInfo(
Usual kInfoType = default,
Usual uNewSetting = default
)
Request Example
View SourceParameters
- kInfoType (Optional)
- Type: Usual
Specifies the type of information.
The constants are described in the Constants section below. Note, however, that not all constants are supported for all RDDs.
Important! DBI_USER is a constant that returns the minimum value that third-party RDD developers can use for defining new kInfoType parameters. Values less than DBI_USER are reserved for Computer Associates development.
- uNewSetting (Optional)
- Type: Usual
If specified, this parameter is used to change the value of a setting.
The data type (and whether uNewSetting can be specified), depends on the kInfoType constant and is documented in the Constants section below.
DBI_ALIAS Returns the alias name of the work area as a string.
DBI_BLOB_HANDLE Returns an integer representing the DOS file handle for a BLOB file.
The constant is most often used in conjunction with DBFieldInfo(DBS_BLOB_LEN, ...) and DBFieldInfo(DBS_BLOB_POINTER, ...) to directly access BLOB fields using low-level functions, such as FRead().
DBI_BLOB_INTEGRITY Tests a BLOB file for the integrity of its internal tables and returns a logical value indicating the success (TRUE) or failure (FALSE) of the integrity check.
This should not generally be necessary, but it is handy if the file's integrity is in question for any reason.
This function does not test the integrity between the .DBF and the BLOB file.
If the integrity check fails, you can run DBInfo(DBI_BLOB_RECOVER), which will automatically correct the BLOB file's tables, however, it will abandon some space within the file that would otherwise be reused.
Important! DBInfo(DBI_BLOB_INTEGRITY) is a disk intensive operation and may slow down processing of the work area significantly, especially on a busy network.
DBI_BLOB_RECOVER Recovers a damaged BLOB file by correcting its internal tables and returns NIL. You should run this function only if DBInfo(DBI_BLOB_INTEGRITY) returns FALSE. Note that after running DBInfo(DBI_BLOB_RECOVER), the BLOB file loses some size efficiency.
DBI_BOF Returns a logical value indicating the work area's beginning-of-file status (see BOF()).
DBI_CANPUTREC Returns a logical value indicating whether the work area supports putting records.
DBI_CHILDCOUNT Returns the number of relations set from this work area.
BI_DB_VERSION Returns the version number of the host RDD (CAVORDDB.DLL or CAVORDD.DLL).
DBI_DBFILTER Returns the filter expression as a string (see DBFilter()).
DBI_EOF Returns a logical value indicating the work area's end-of-file status (see EOF()).
DBI_FCOUNT Returns the number of fields (see FCount()).
DBI_FILEHANDLE Returns an integer representing the DOS file handle for this database file.
DBI_FOUND Returns a logical value indicating the success or failure of the last seek operation in the work area (see Found()).
DBI_FULLPATH Returns the full path name of opened database file.
DBI_GETDELIMITER Returns the default delimiter.
DBI_GETHEADERSIZE
Returns the header size of the file (see Header()).
DBI_GETLOCKARRAY Returns the array of locked records.
DBI_GETRECSIZE Returns the record size of the file (see RecSize()).
DBI_GETSCOPE Returns the locate condition as a code block.
DBI_ISANSI Returns the ANSI flag of the database file (TRUE for ANSI and FALSE for OEM).
DBI_ISDBF Returns a logical value indicating whether the RDD provides support for the .DBF file format.
DBI_ISFLOCK Returns the file lock status.
DBI_LASTUPDATE Returns the last date on which the file was updated (see LUpdate()).
DBI_LOCKCOUNT Returns the number of locked records.
DBI_LOCKOFFSET Returns the current locking offset as a numeric value.
DBI_MEMOBLOCKSIZE
Returns the block size for the memo file associated with this database.
DBI_MEMOEXT Returns the default extension for the memo file associated with this database.
DBI_MEMOHANDLE Returns an integer representing the DOS file handle for the memo file associated with this database file.
DBI_RDD_LIST Returns the _RDDLIST structure containing the list of RDDs used for the current workarea.
DBI_RDD_VERSION Returns the version number of the RDD for this database.
DBI_SETDELIMITER Sets the default delimiter.
DBI_SHARED Returns the shared flag value.
DBI_TABLEEXT Returns the database file extension.
DBI_VALIDBUFFER Returns a logical value indicating whether the current buffer is valid.
Return Value
Type:
Usual
If
uNewSetting is not specified, RDDInfo() returns the current setting.
If
uNewSetting is specified, the previous setting is returned.
Remarks
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression
Examples
The following examples return work area information:
1? DBInfo(DBI_GETHEADERSIZE)
2? DBInfo(DBI_LASTUPDATE)
3? DBInfo(DBI_GETRECSIZE)
4? DBInfo(DBI_FULLPATH)
The following example will display all RDDs used in the current workarea:
1FUNCTION RddTest()
2 LOCAL n, i AS INT
3 LOCAL rddList AS _RDDLIST
4 USE Demo NEW
5 rddList := DBInfo(DBI_RDD_LIST)
6 ? "Involved Rdds: ", rddList.uiRddCount
7 FOR i := 1 UPTO rddList.uiRddCount
8 ? rddList.atomRddName[I]
9 NEXT I
10 MemFree(rddList)
11 RETURN
See Also