I want to write a small classlib that will handle tableupdates.
My idea starts something like this:
lPARAMETERS llUseTransaction, aTableUpdateArray
IF llUseTransaction = .T.
BEGIN TRANSACTION
ENDIF
lnNumberOfTables = ALEN(aTableUpdateArray, 1)
FOR lnCounter = 1 TO lnNumberOfTables
lcTableUpdateName = aTableUpdateArray[lnCounter, 1]
llTableUpdate = TABLEUPDATE(2, .F., &lcTableUpdateName, aUpdateError)
The questions I have are this:
1. Is there a way to determine if you're already in a transaction?
2. When using the tableupdate() command this way, if the lcTableUpdateName is a remote view, how should the code look if the command fails?
Begin Transaction
....then llTableUpdate = .F. ....
TableRevert(&lcTableUpdateName)
Rollback
End Transaction
...I guess I'm asking if I need both the tablerevert & Rollback if Im inside a transaction...
thanks!
ICQ 10556 (ya), 254117