Renoir-
>Assume a buffered base table called Codes and two views called vCodes and vDetail. I normally do something like the following using Optimistic Row Buffering:
>
>
>If TableUpdate(.T.,.T.,'vDetail') = .F.
> Tablerevert('vDetail')
> Wait Window ' Save record Failed! ' timeout 3
>Else
> Tableupdate(.T.,.T.,'Codes')
> Requery('vCodes')
> Requery('vDetail')
>Endif
>
>
>If I just change the buffering settings to 5 instead of 3 do I have any other concerns or will it just happily start using table buffering?
Well, this little bit of code? No, since your forcing an update to all rows. But of course there's no way to say for the rest of your application.
FWIW, this is fairly brutish (not that I haven't done it this way, too). What if another user has made a change to a record? They just lost their changes.
Also, you need to check the return from the Codes update. It might fail.
IF TableUpdate OneTable
IF TableUpdate AnotherTable
Great!
ELSE
TableRevert, or give the user some message about the failure and a chance to revert.
ENDIF
ELSE
TableRevert, or give the user some message about the failure and a chance to revert.
ENDIF
Note that nesting these really implies a need for Transactions, as has been pointed out to you.
Always, always, always check the return from tableupdate.