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.08
Syntax
 FUNCTION DbCloseAll() AS LOGIC
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#
cLast := "Winston"
DBUseArea(TRUE, "DBFNTX", "sales", "Sales", TRUE)
Sales->DBSetIndex("salefnam")
Sales->DBSetIndex("salelnam")
DBUseArea(TRUE, "DBFNTX", "colls", "Colls", TRUE)
Colls->DBSetIndex("collffnam")
Colls->DBSetIndex("colllnam")
// Select "Sales" work area
IF (Sales->DBSeek(cLast))
        IF Sales->Deleted()
                IF Sales->RLock()
                        Sales->DBRecall()
                        QOut("Record deleted: ", Sales->Deleted())
                ENDIF
        ENDIF
ELSE
        QOut("Not found")
ENDIF
DBCloseAll()                                // Close all work areas
See Also