|
<< Click to Display Table of Contents >> Delphi Examples: DbiUndeleteRecord |
![]() ![]()
|
Undeletes a dBASE record if it is supported.
This example uses the following input:
fDbiUndeleteRecord(AnimalTbl);
The procedure is:
procedure fDbiUndeleteRecord(dBASETbl: TTable);
var
CProps: CurProps;
begin
Check(DbiGetCursorProps(dBASETbl.Handle, CProps));
// Raise an EDBEngineError exception if the table is not dBASE
if (StrIComp(CProps.szTableType, szDBASE) <> 0) then
raise EDBEngineError.Create(DBIERR_NOTSUPPORTED);
// Raise an EDatabaseError exception if the cursor does not have soft deletes on
if (CProps.bDeletedOn = False) then
raise EDatabaseError.Create('Soft deletes is not on');
Check(DbiUndeleteRecord(dBASETbl.Handle));
end;