>My code looks something like this:
>
>IF !TABLEUPDATE(2,.f.,"Table1") OR !TABLEUPDATE(2,.f.,"Table2") OR ;
> !TABLEUPDATE(2,.f.,"Table3")
> llError=.t.
>ENDIF
>IF llError
> ROLLBACK
>ELSE
> END TRANSACTION
>ENDIF
>
>The record is there after the TABLEUPDATE. It loses it after the END TRANSACTION.
>
>Elyse
Well, unless I'm missing something, I don't see anything specifically wrong with this code.
Not that it matters technically, but are you using record or table buffering? I prefer table buffering because it gives me more control and keeps "accidental" updates from happening.
Others might disagree but, personally, I would change the code to read somewhat like this:
llError = .F.
BEGIN TRANSACTION
IF TABLEUPDATE( 2, .F., "Table1" )
IF TABLEUPDATE( 2, .F., "Table2" )
IF NOT TABLEUPDATE( 2, .F., "Table3" )
llError = .T.
ENDIF
ELSE
llError = .T.
ENDIF
ELSE
llError = .T.
ENDIF
IF llError
ROLLBACK
ELSE
END TRANSACTION
ENDIF
I prefer code like this cause it seems clearer to me and I can run it in DEBUG to check each TABLEUPDATE() as they happen and whatever info I need at each TABLEUPDATE().
At this point I don't know what else to suggest. maybe someone else can give another perspective.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.