>nRetVal = SQLSETPROP( oApp.conn_handle1, "transactions", 2) >nRetVal = SQLSETPROP( oApp.conn_handle1, "Asynchronous", .T.) > >nRetVal = SQLSETPROP( oApp.conn_handle2, "transactions", 2) >nRetVal = SQLSETPROP( oApp.conn_handle2, "Asynchronous", .T.) > >IF nRetVal > 0 > nRetVal1=SQLEXEC( oApp.conn_handle1, "Update MyTable1 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) > nRetVal2=SQLEXEC( oApp.conn_handle2, "Update MyTable2 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) > > DO WHILE nRetVal1=0 OR nRetVal2=0 > IF nRetVal1=0 > nRetVal1=SQLEXEC( oApp.conn_handle1, "Update MyTable1 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) > ENDIF > IF nRetVal1=0 > nRetVal2=SQLEXEC( oApp.conn_handle2, "Update MyTable2 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) > ENDIF > ENDDO > > IF nRetVal1 < 0 > SQLROLLBACK(oApp.conn_handle1) > ELSE > SQLCOMMIT(oApp.conn_handle1) > ENDIF > > IF nRetVal2 < 0 > SQLROLLBACK(oApp.conn_handle2) > ELSE > SQLCOMMIT(oApp.conn_handle2) > ENDIF > >ENDIF >>
>>>nRetVal = SQLSETPROP( oApp.conn_handle, "transactions", 2) >>> >>>IF nRetVal < 0 >>> RETURN .F. >>>ENDIF >>> >>>IF nRetVal > 0 >>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable1 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>ENDIF >>>SUSP && run code for second vfp >>> >>>IF nRetVal > 0 >>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable2 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>ENDIF >>> >>>IF nRetVal < 0 >>> SQLROLLBACK(oApp.conn_handle) >>>ELSE >>> SQLCOMMIT(oApp.conn_handle) >>>ENDIF >>>>>>
>>>nRetVal = SQLSETPROP( oApp.conn_handle, "transactions", 2) >>> >>>IF nRetVal < 0 >>> RETURN .F. >>>ENDIF >>> >>>IF nRetVal > 0 >>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable1 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>ENDIF >>> >>>SUSP >>> >>>IF nRetVal > 0 >>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable2 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>ENDIF >>> >>>IF nRetVal < 0 >>> SQLROLLBACK(oApp.conn_handle) >>>ELSE >>> SQLCOMMIT(oApp.conn_handle) >>>ENDIF >>>>>>
>>>>*-- oApp.conn_handle is the Connection Handle number obtained when application connects to the SQL Server. >>>> >>>>nRetVal = SQLSETPROP( oApp.conn_handle, "transactions", 2) >>>> >>>>IF nRetVal < 0 >>>> RETURN .F. >>>>ENDIF >>>> >>>>IF nRetVal > 0 >>>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable1 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>>ENDIF >>>> >>>>IF nRetVal > 0 >>>> nRetVal = SQLEXEC( oApp.conn_handle, "Update MyTable2 SET MyField1 = '123' WHERE MyField1 = 'ABC"" ) >>>>ENDIF >>>> >>>>IF nRetVal < 0 >>>> SQLROLLBACK(oApp.conn_handle) >>>>ELSE >>>> SQLCOMMIT(oApp.conn_handle) >>>>ENDIF >>>> >>>>nRetVal = SQLSETPROP( oApp.conn_handle, "transactions", 1) >>>> >>>>>>>>