If sqlsetprop ( connobj.handle, “TRANSACTIONS”, 2 ) llOk = tableupdate ( 2, .f., “VPREDIOS” ) ; AND tableupdate ( 2, .f., “VHISCRED” ) ; AND tableupdate ( 2, .f., “VRECIBOS” ) ; AND tableupdate ( 2, .f., “VDRECIBOS” ) IF llOk * commit transactions connobj.commit else connobj.rollback endif endif sqlsetprop ( connobj.handle, “TRANSACTIONS”, 1 )>Actually we are developing a SQL application with a VFP Front End. In this application I use both remote views and SQL pass trough (SPT). To use SPT I develop a object named CONNOBJ that execute instructions, scripts, etc. I observe all the system works fine except for the manual transactions. I have a form using 4 remote views and I want to save to SQL server but using transactions. This is my code:
>If sqlsetprop ( connobj.handle, “TRANSACTIONS”, 2 ) then > If tableupdate ( 2, .f., “VPREDIOS” ) then > If tableupdate ( 2, .f., “VHISCRED” ) then > Wait “Transaction Tests “ window > If tableupdate ( 2, .f., “VRECIBOS” ) then > If tableupdate ( 2, .f., “VDRECIBOS” ) then > * commit transactions > connobj.commit > else > * rollback transactions > connobj.rollback > endif > else > connobj.rollback > endif > else > connobj.rollback > endif > else > connobj.rollback > endif >else > connobj.rollback >endif >sqlsetprop ( connobj.handle, “TRANSACTIONS”, 1 )>I test my CONNSQL object outside of my program and the transactions works fine !!!. But when use in my form don’t work!!!. I try SQLSETPROP ( 0, …. ) and DBSETPROP() but still don´t work. For testing I disconnect my PC from the network between the TABLEUPDATE() instructions and I observe that SQL SERVER update my first tables without receiving the SQLCOMMIT.