Click or drag to resize

VoDbCloseAll Function

Close all files in all work areas.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION VoDbCloseAll() AS LOGIC
View Source

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
VODBCloseAll() is the same as DBCloseAll().  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 global structure, StrucErrInfo, will contain needed information regarding any error that occurs.  See DBCloseAll() for more information.
Examples
The following example closes all work areas:
X#
LOCAL rddList       AS _RDDLIST
...
aRdds := {"CAVODBF", "DBFNTX"}
n       := ALen(aRdds)
rddList := MemAlloc( (_SizeOf(DWORD)) + (n * _SizeOf(SYMBOL)) )
rddList.uiRddCount := n
FOR i := 1 TO n
        rddList.atomRddName[i] := SysAddAtomUpperA(aRdds[i])
NEXT
VODBUseArea(TRUE, rddList, "sales", "sales", TRUE, FALSE)
VODBOrdListAdd("Last", NIL)
VODBUseArea(TRUE, rddList, "customer", "", TRUE, FALSE)
MemFree(rddList)
cLast := customer->last
IF (Sales->(VODBSeek(cLast)))
        IF Sales->(Deleted())
                IF RLock()
                        Sales->(VODBRecall())
                        ? "Record deleted: ", sales;
                                (Deleted())
                ENDIF
        ENDIF
ELSE
        ? "Not found"
ENDIF
VODBCloseAll()                // Close all work areas
See Also