Hi guys,
I trying to implement the BEGIN TRANSACTION in both VFP & SQL 2000, the code is listed below.
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( nConnection, 'IF @@TRANCOUNT > 0 COMMIT' )
end transaction
else
SQLExec( nConnection, 'IF @@TRANCOUNT > 0 ROLLBACK' )
rollback
Endif
The problem here is that it does not work. Even if the VFP Transaction and Sql Transactions were rolled back to their original state, the changes were still committed to the database.
Did I missed something?
Any Idea?
Thanks in advance
Music Rocks
www.musicreserve.blogspot.comSuccess 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.