Click or drag to resize

VoDbCommitAll Function

X#
Flush pending updates in all work areas.

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

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
VODBCommitAll() is the same as DBCommitAll().
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 LastRddError property in the runtime state. will contain needed information regarding any error that occurs.
See DbAppend(Usual, Usual) for more information.
Examples
The following example writes all pending updates to disk:
X#
 1FUNCTION Start()
 2    LOCAL rddList       AS _RDDLIST
 3    aRdds := {"CAVODBF", "DBFNTX"}
 4    n       := ALen(aRdds)
 5    rddList := MemAlloc( (_SizeOf(DWORD)) + (n * _SizeOf(SYMBOL)) )
 6    rddList.uiRddCount := n
 7    FOR i := 1 TO n
 8        rddList.atomRddName[i] := SysAddAtomUpperA(aRdds[i])
 9    NEXT
10    cLast := "Winston"
11    VODBUseArea(TRUE, rddList, "sales", "sales", TRUE, FALSE)
12    VODBOrdListAdd("SaleFNam", NIL)
13    VODBOrdListAdd("SaleLNam", NIL)
14    VODBUseArea(TRUE, rddList, "colls", "colls", TRUE, FALSE)
15    VODBOrdListAdd("CollFNam", NIL)
16    VODBOrdListAdd("CollLNam", NIL)
17    MemFree(rddList)
18    DBSelectArea("sales")
19    // Select "sales" workarea
20    IF (Sales->(VODBSeek(cLast)))
21        IF Sales->(Deleted()) .AND. sales(RLock())
22            Sales->(VODBRecall())
23            ? "Deleted record has been recalled."
24        ENDIF
25    ELSE
26        ? "Not found"
27    ENDIF
28    // Processing done, write updates to disk and
29    // close files
30    VODBCommitAll()
31    VODBCloseAll()
32    RETURN TRUE
See Also