Return to Language Reference home pageHarbour API Explorer
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Only APIs with Curated Documentation are available from this screen.
Most API (functions) description comes from https://github.com/Petewg/harbour-core/wiki. Same content license applies.
To search all Harbour Core, Contribs and Packages APIs, including undocumented ones, go to Source Code Explorer.
Found 46 APIs
Alias([<nWorkarea>]) ➔ <cAlias|"">

Returns the alias of the <nWorkArea> or the alias of the current work area if <nWorkArea> is not provided.
If no database file is opened in current or given work area, it returns null string (zero length string).
NOTE: if no explicit alias specified during opening, the default alias of the opened dbf, is the filename without path and extension.


DBCLEARFIL => dbClearFilter() ➔ NIL

Clears any active filter condition for the current or aliased work area.


dbClearFilter() ➔ NIL

Clears any active filter condition for the current or aliased work area.


DBCLEARREL => dbClearRelation() ➔ NIL

Clears all active relations in the current work area.


dbClearRelation() ➔ NIL

Clears all active relations in the current work area.


dbCloseAll() ➔ NIL

Cose all open databases, associated indexes and format files and moves the work area pointer to the first position.


DBCLOSEARE => dbCloseArea() ➔ NIL

Closes an open database (if any) in the selected or aliased work area.


dbCloseArea() ➔ NIL

Closes an open database (if any) in the selected or aliased work area.


dbEval(<bBlock>,[<bForCondition>],[<bWhileCondition>],[<nNextRecords>],[<nRecord>],[<lRest>]) ➔ NIL

Evaluates <bBlock> for all records in the current work area. A matching scope can be defined with <bFor>/<bWhile> blocks.
This could be represented as SCAN on all records.


Dbf() ➔ <cAlias>

Returns the alias name of the currently selected work area.
Compatibility function superseded by the Alias()


dbFilter() ➔ <cFilter>

Returns a character string containing the filter expression of a work area, or a null string ("") when no filter is set.


dbGoBottom() ➔ NIL

Moves to the last logical record in the current work area.


dbGoTo(<xIdentity>) ➔ NIL

Position record pointer to a specific identity which for Xbase .dbfs is record number. In other data formats, <xIdentity> is the unique primary key value.


dbGoTop() ➔ NIL

Move to the first logical record.


DBORDERINF => dbOrderInfo(<nInfoType>,[<cIndexFile>],[<cOrder|nPosition>],[<xExpNewSetting>]) ➔ <xCurrentSetting>

Return and optionally change information about orders and index files. Refer to 'dbinfo.ch' header file for more.


dbOrderInfo(<nInfoType>,[<cIndexFile>],[<cOrder|nPosition>],[<xExpNewSetting>]) ➔ <xCurrentSetting>

Return and optionally change information about orders and index files. Refer to 'dbinfo.ch' header file for more.


dbRelation(<nRelation>) ➔ <cLinkExpression>

Returns a character string containing the relation expression specified with <nRelation>, or a null string ("") when no relation exists for <nRelation>.


DBRLOCKLIS => dbRLockList() ➔ <aRecordLocks>

Returns a list of locked records in the database work area.


dbRLockList() ➔ <aRecordLocks>

Returns a list of locked records in the database work area.


dbRSelect(<nRelation>) ➔ <nWorkArea>

Returns the work area number of the relation specified with <nRelation> or zero if no relation is defined.


dbRUnlock(<xRecno>) ➔ NIL

Releases record lock for <nRecno>. If no <nRecno> is passed function, all active record locks are released. (same as 'DbUnlock()').


DBSELECTAR => dbSelectArea(<nArea|cAlias>) ➔ NIL

Selects <nArea> or <cAlias> and set it as current work area.


dbSelectArea(<nArea|cAlias>) ➔ NIL

Selects <nArea> or <cAlias> and set it as current work area.


DBSETFILTE => dbSetFilter([<bCondition>],[<cCondition>]) ➔ NIL

Sets a filter condition in form of the code block . If <bCondition> is NIL (empty), it clears any active filter.


dbSetFilter([<bCondition>],[<cCondition>]) ➔ NIL

Sets a filter condition in form of the code block . If <bCondition> is NIL (empty), it clears any active filter.


dbSetOrder(<nOrderNum>)

Selects the controlling index.


DBSETRELAT => dbSetRelation(<nArea|cAlias>,<bRelation>,<cRelation>,<lScoped>) ➔ NIL

Relates a parent work area with the child work area <nArea> or <cAlias>. Existing relations remain active.


dbSetRelation(<nArea|cAlias>,<bRelation>,<cRelation>,<lScoped>) ➔ NIL

Relates a parent work area with the child work area <nArea> or <cAlias>. Existing relations remain active.


dbSkip(<nRecords>) ➔ NIL

dbUseArea([<lNewArea>],[<cRddName>],[<cDatabase>],[<cAlias>],[<lShared>],[<lReadOnly>],[<cCodePage>],[<nConnection>]) ➔ <lSuccess>

Attempts to open a database file and returns true (.T.) on success, otherwise false (.F.).
This function is same, in functionality, as the standard USE command, yet more flexible.
If <lNewArea> specified true (.T.) the file is opened in a new work area otherwise if is false (.F.) or omitted,
the current area is used, which means any dbf that already is opened in the area will close.
<cRddName> is optional name of the database driver which will be used. If omitted, the current default driver is used.
<cDatabase> is the name of the database (.dbf) file to be opened.
<xcAlias> is optional character value that defines the alias to be associated with the work area. If omitted, the filename without path and extension is used.
<lShared> is optional logical value that specifies whether the file will be shareable to other users or not. If omitted, the current global _SET_EXCLUSIVE setting is used.
<lReadonly> is the optional logical value that specifies whether the work area and the dbf file is writable or not. If omitted, it defaults to false (.F.), i.e., the file can be updated.
<cCodePage> is the Harbour CP to be used by the work area.
<nConnection> Connection handler for RDDs which support it


hb_dbGetFilter() ➔ <bCode|NIL>

Returns codeblock used as work area filter or NIL if no filter is active.


hb_WAEval(<pBlock>) ➔ NIL

This function evaluates a given <pBlock> code-block in each used work area (in other words, the given code-block is evaluated _iteratively_ , against _all_ opened work areas). If <pBlock> return .F. (FALSE), the iteration is interrupted otherwise the evaluation continues until all work areas been processed.


Select([<cAlias>]) ➔ <nWorkArea>

Returns the number of workarea with the given <cAlias>. If no <cAlias> specified, the currently selected work area number is returned or 1 if none selected (used). If a <cAlias> is given but it doesn't exist or is invalid, function returns 0 zero.
NOTE: The Select(<cAlias>) function does NOT select the <cAlias> workarea, (i.e., does not change current workarea), it just retrieves and return its number (if any).
Yet, it can be easily confused (but must not!) with SELECT command.


Used() ➔ <lDfbOpen>

Returns .T. if a database is in use, otherwise .F.


__DBCLEARRELATION => dbClearRelation() ➔ NIL

Clears all active relations in the current work area.


__DBCLOSE => dbCloseArea() ➔ NIL

Closes an open database (if any) in the selected or aliased work area.


__DBCLOSEAREA => dbCloseAll() ➔ NIL

Cose all open databases, associated indexes and format files and moves the work area pointer to the first position.


__DBGOBOTTOM => dbGoBottom() ➔ NIL

Moves to the last logical record in the current work area.


__DBGOTO => dbGoTo(<xIdentity>) ➔ NIL

Position record pointer to a specific identity which for Xbase .dbfs is record number. In other data formats, <xIdentity> is the unique primary key value.


__DBGOTOP => dbGoTop() ➔ NIL

Move to the first logical record.


__DBSELECT => dbSelectArea(<nArea|cAlias>) ➔ NIL

Selects <nArea> or <cAlias> and set it as current work area.


__DBSETFILTER => dbSetFilter([<bCondition>],[<cCondition>]) ➔ NIL

Sets a filter condition in form of the code block . If <bCondition> is NIL (empty), it clears any active filter.


__DBSETORDER => dbSetOrder(<nOrderNum>)

Selects the controlling index.


__DBSETRELATION => dbSetRelation(<nArea|cAlias>,<bRelation>,<cRelation>,<lScoped>) ➔ NIL

Relates a parent work area with the child work area <nArea> or <cAlias>. Existing relations remain active.


__DBSKIP => dbSkip(<nRecords>) ➔ NIL

__DBUSE => dbUseArea([<lNewArea>],[<cRddName>],[<cDatabase>],[<cAlias>],[<lShared>],[<lReadOnly>],[<cCodePage>],[<nConnection>]) ➔ <lSuccess>

Attempts to open a database file and returns true (.T.) on success, otherwise false (.F.).
This function is same, in functionality, as the standard USE command, yet more flexible.
If <lNewArea> specified true (.T.) the file is opened in a new work area otherwise if is false (.F.) or omitted,
the current area is used, which means any dbf that already is opened in the area will close.
<cRddName> is optional name of the database driver which will be used. If omitted, the current default driver is used.
<cDatabase> is the name of the database (.dbf) file to be opened.
<xcAlias> is optional character value that defines the alias to be associated with the work area. If omitted, the filename without path and extension is used.
<lShared> is optional logical value that specifies whether the file will be shareable to other users or not. If omitted, the current global _SET_EXCLUSIVE setting is used.
<lReadonly> is the optional logical value that specifies whether the work area and the dbf file is writable or not. If omitted, it defaults to false (.F.), i.e., the file can be updated.
<cCodePage> is the Harbour CP to be used by the work area.
<nConnection> Connection handler for RDDs which support it