>Is this a correct way to handle SQL transactions?
>
>2 sql views
>
>BEGIN TRANS
>.
>.
>code for mods to both views, i.e. adding records, updating fields
>.
>.
>lupdateok=tableupdate(1,.t.,'view_a')
>lupdateok=lupdateok and tableupdate(1,.t.,'view_b')
>
>IF NOT lupdateok
> ROLLBACK
>ELSE
> END TRANS
>ENDIF
I haven't tried your code which seems render the same output like what we do:
Begin Trans
lupdateok = .T.
If !TableUpdate(1,.t.,'view_a')
lupdateok = .F.
Endif
If lupdateok And !TableUpdate(1,.t.,'view_b')
lupdateok = .F.
Endif
If lupdateOk
End Trans
else
Rollback
Endif
We usually put this on the save method of the form.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net
CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."