Click or drag to resize

DbCommitAll Function

X#
Flush all pending updates in all work areas.

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

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
DBCommitAll() causes all pending updates to all work areas to be written to disk.
It is equivalent to calling DBCommit() for every occupied work area. For more information, refer to DBCommit().
Tip Tip
DBCommitAll() uses DOS interrupt 21h function 68h to perform the solid-disk write.
It is up to the network software to properly implement this request. Check with the network software vendor to see if this is supported.
Examples
The following example writes all pending updates to disk:
X#
 1FUNCTION Start()
 2    LOCAL cLast := "Winston"
 3    DBUseArea(TRUE, "DBFNTX", "sales", ;
 4                "Sales", TRUE)
 5    Sales->DBSetIndex("salefnam")
 6    Sales->DBSetIndex("salelnam")
 7    DBUseArea(TRUE, "DBFNTX", "colls", "Colls", ;
 8                TRUE)
 9    Colls->DBSetIndex("collfnam")
10    Colls->DBSetIndex("colllnam")
11    IF Sales->DBSeek(cLast)
12        IF Sales->Deleted() .AND. Sales->RLock()
13            Sales->DBRecall()
14            QOut("Deleted record recalled.")
15        ENDIF
16    ELSE
17        QOut("Not found")
18    ENDIF
19    // Processing done, write updates to disk and
20    // close files
21    DBCommitAll()
22    DBCloseAll()
See Also