Click or drag to resize

DbCloseAll Function

Close all files in all work areas.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.6
Syntax
 FUNCTION DbCloseAll() AS LOGIC
Request Example View Source

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
DBCloseAll() releases all occupied work areas from use.
It is equivalent to calling DBCloseArea() on every occupied work area. DBCloseAll() has the same effect as the CLOSE DATABASES command.
For more information, refer to the CLOSE command.
Examples
The following example closes all work areas:
X#
 1cLast := "Winston"
 2DBUseArea(TRUE, "DBFNTX", "sales", "Sales", TRUE)
 3Sales->DBSetIndex("salefnam")
 4Sales->DBSetIndex("salelnam")
 5DBUseArea(TRUE, "DBFNTX", "colls", "Colls", TRUE)
 6Colls->DBSetIndex("collffnam")
 7Colls->DBSetIndex("colllnam")
 8// Select "Sales" work area
 9IF (Sales->DBSeek(cLast))
10    IF Sales->Deleted()
11        IF Sales->RLock()
12            Sales->DBRecall()
13            QOut("Record deleted: ", Sales->Deleted())
14        ENDIF
15    ENDIF
16ELSE
17    QOut("Not found")
18ENDIF
19DBCloseAll()                // Close all work areas
See Also