>Hi
>
>I had the same idea too. The only difference is that I want to RECALL all the records that were deleted on the process. My biggest concern is how the user will have to deal with this unwanted data. Do you know how to reproduce a case like this?
>
>Regards
Once the records are deleted, you should consider them deleted, gone, disappeared. Normally you shouldn't give the user the option to recall a record deleted some days ago; this would cause too much trouble.
In this case, assuming you want to undo changes if something fails, you don't need to recall anything. Instead, you use transactions. Here is a typical example:
local llSuccess
use MyTable
CursorSetProp("Buffering", 5)
begin transaction
scan for (some condition)
delete
llSuccess = TableUpdate()
if not llSuccess
TableRevert()
exit
endif
endscan
if llSuccess
end transaction
MessageBox("Success")
else
rollback
MessageBox("Some records could not be deleted. All changes were undone.")
endif
Note that with older versions of Visual FoxPro (including version 6), the transaction only works for tables in a database.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)