Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin Transaction command in VFP and SQL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00947828
Message ID:
00947837
Views:
21
Hi Bernard,

Sorry bout the sample code my mistake. I used only one connection. Here is the original code

begin transaction
SQLExec( nConn, 'BEGIN TRANSACTION' )
* Update changes to biophysicalrv remote view.
lEverythingOK = tableupdate( 2, .F., 'biophysicalrv' )
if lEverythingOK
* Update changes to itemsrv.
lEverythingOK = tableupdate( 2,.F.,'itemsrv')
endif

lEverythingOK = .F. && I placed this code to tell the program that it needs to roll back the transactions.

* End the transaction on the server and VFP.
If lEverythingOK
SQLExec( nConn, 'IF @@TRANCOUNT > 0 COMMIT' )
end transaction
else
SQLExec( nConn, 'IF @@TRANCOUNT > 0 ROLLBACK' )
rollback
Endif
Music Rocks www.musicreserve.blogspot.com
Success is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform