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.4a
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#
 1LOCAL rddList       AS _RDDLIST
 2...
 3aRdds := {"CAVODBF", "DBFNTX"}
 4n       := ALen(aRdds)
 5rddList := MemAlloc( (_SizeOf(DWORD)) + (n * _SizeOf(SYMBOL)) )
 6rddList.uiRddCount := n
 7FOR i := 1 TO n
 8    rddList.atomRddName[i] := SysAddAtomUpperA(aRdds[i])
 9NEXT
10VODBUseArea(TRUE, rddList, "sales", "sales", TRUE, FALSE)
11VODBOrdListAdd("Last", NIL)
12VODBUseArea(TRUE, rddList, "customer", "", TRUE, FALSE)
13MemFree(rddList)
14cLast := customer->last
15IF (Sales->(VODBSeek(cLast)))
16    IF Sales->(Deleted())
17        IF RLock()
18            Sales->(VODBRecall())
19            ? "Record deleted: ", sales;
20                (Deleted())
21        ENDIF
22    ENDIF
23ELSE
24    ? "Not found"
25ENDIF
26VODBCloseAll()        // Close all work areas
See Also