Click or drag to resize

VoDbInfo Function (DWord, Usual)

X#
Retrieve information about a work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION VoDbInfo(
	kInfoType AS DWORD,
	ptrRetVal REF USUAL
) AS LOGIC
Request Example View Source

Parameters

kInfoType
Type: DWord
Determines what type of information is retrieved. See the table in the Remarks section below.
ptrRetVal
Type: Usual
A (reference to) a value.
This value will receive the requested information if the function is successful and will be unchanged otherwise.
If you just want to retrieve information, this value must be NIL before calling the function.
Using a non-NIL value is not currently supported by any of the supplied RDDs .
This feature is reserved for RDDs that allow you to change the information rather than just retrieve it.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
VODBInfo() is similar to DBInfo().
This function, however, does not call the error handler and will not, therefore, produce a runtime error message or create an error object if it fails. Thus, it may be important to check the return value to determine if the function succeeded.
the LastRddError property in the runtime state. will contain needed information regarding any error that occurs.
See DbInfo(Usual, Usual) for more information.
Tip Tip
The values in the table below exist both as DEFINEs and also as members of the DbInfo enum.
You can see the numeric values of the defines in the documentation of this Enum.
ConstantDescription
DBI_ALIASReturns 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. T he constant is most often used in conjunction with DBServer:FieldInfo(DBS_BLOB_LEN, ...) and DBServer:FieldInfo(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 does not test the integrity between the .DBF and the BLOB file.
If the integrity check fails, you can run DBServer:Info(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! DBServer:Info(DBI_BLOB_INTEGRITY) is a disk intensive operation and may slow down processing of the data server significantly, especially on a busy network.
DBI_BLOB_RECOVERRecovers a damaged BLOB file by correcting its internal tables and returns NIL. You should run this only if DBServer:Info(DBI_BLOB_INTEGRITY) returns FALSE. Note that after running DBServer:Info(DBI_BLOB_RECOVER), the BLOB file loses some size efficiency.
DBI_BOFReturns a logical value indicating the data server's beginning-of-file status (see DBServer:BOF).
DBI_CANPUTRECReturns a logical value indicating whether the data server supports putting records.
DBI_CHILDCOUNTReturns the number of relations set from this data server.
DBI_DB_VERSIONReturns the version number of the host RDD (CAVORDDB.DLL or CAVORDD.DLL).
DBI_DBFILTERReturns the filter expression as a string (see DBServer:Filter).
DBI_EOFReturns a logical value indicating the data server's end-of-file status (see DBServer:EOF).
DBI_FCOUNTReturns the number of fields (see DBServer:FCount).
DBI_FILEHANDLEReturns an IntPtr representing the file handle for this database file.
DBI_FILESTREAMReturns a stream object representing the file stream for this database file.
DBI_FOUNDReturns a logical value indicating the success or filure of the last seek operation for this data server (see DBServer:Found).
DBI_FULLPATHReturns the full path name of opened database file.
DBI_GETDELIMITERReturns the default delimiter.
DBI_GETHEADERSIZEReturns the header size of the file (see DBServer:Header).
DBI_GETLOCKARRAYReturns the array of locked records.
DBI_GETRECSIZEReturns the record size of the file (see DBServer:RecSize).
DBI_GETSCOPEReturns the locate condition as a code block.
DBI_ISANSIReturns the ANSI flag of the database file (TRUE for ANSI and FALSE for OEM).
DBI_ISDBFReturns a logical value indicating whether the RDD provides support for the .DBF file format.
DBI_ISFLOCKReturns the file lock status.
DBI_LASTUPDATEReturns the last date on which the file was updated (see DBServer:LUpdate).
DBI_LOCKCOUNTReturns the number of locked records.
DBI_LOCKOFFSETReturns the current locking offset as a numeric value.
DBI_MEMOBLOCKSIZEReturns the block size for the memo file associated with this database.
DBI_MEMOEXTReturns the default extension for the memo file associated with this database.
DBI_MEMOHANDLEReturns an intptr representing the DOS file handle for the memo file associated with this database file.
DBI_MEMOSTREAMReturns a stream object representing the file stream for the memo file associated with this database file.
DBI_RDD_VERSIONReturns the version number of the RDD for this database.
DBI_SETDELIMITERSets the default delimiter.
DBI_SHAREDReturns the shared flag value.
DBI_TABLEEXTReturns the database file extension.
DBI_VALIDBUFFERReturns a logical value indicating whether the current buffer is valid.
DBI_USERStart of user defined DBI_ values.
Tip Tip
DBI_USER is a constant that returns the minimum value that third-party RDD developers can use for defining new parameters. Values less than DBI_USER are reserved for X# development.
Examples
The following examples return work area information:
X#
 1FUNCTION ShowInfo() AS VOID
 2    LOCAL uResult AS USUAL
 3    uResult := NIL
 4    IF VODBInfo(DBI_GETHEADERSIZE, @uResult)
 5        ? "HEADER(): ", uResult
 6    ELSE
 7        DoError()
 8    ENDIF
 9    IF VODBInfo(DBI_LASTUPDATE, @uResult)
10        ? "LUpdate(): ", uResult
11    ELSE
12        DoError()
13    ENDIF
14    IF VODBInfo(DBI_GETRECSIZE, @uResult)
15        ? "RecSize(): ", uResult
16    ELSE
17        DoError()
18    ENDIF
19    IF VODBInfo(DBI_FULLPATH, @uResult)
20        ? "PATHNAME: ", uResult
21    ELSE
22        DoError()
23    ENDIF
24    RETURN
25STATIC FUNCTION DoError() AS USUAL
26    LOCAL uRetCodeAS USUAL
27    LOCAL oError  AS USUAL
28    oError := ErrorBuild(RuntimeState.LastRddError)
29    oError:FuncSym := #VODBInfo
30    RETURN EVAL(ErrorBlock(), oError)
See Also