>I would like to change an existing program that uses several insert into and replace commands. Application is written for VFP 7, SDT 6.1, ,used private datasessions, uses optomistic buffering, is multi-user and runs on a novell server. General structure is
>
>insert into ...
>insert into ...
>if rlock(.)
> replace ...
>endif
>
>It has no error checking and what I which I want to add. After reading documentation I am not sure of best way to di this. Can I use begin end transcaction to encampulate the transactions, can I use tableupate to check if insert worked, etc.
>
>Any suggestion appreciated. TIA
What optimistic buffering do you use, table, or record?
You don't necessarily need transactions.
If you use table buffering, you can confirm all changes in all modified records with TableUpdate(). You can undo changes to all modified records with TableRevert().
If you use row buffering, you can only undo changes to the current record. Going to another record will implicitly save (equivalent of TableUpdate())the current record.
You might need transactions if you work with several tables, and you want to save "all or nothing" (because the changes are interdependent).
HTH,
Hilmar.
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)