General information
Title:
SPT and Ado Transactions. VFP 6
Hello Cetin,
How do i accomplish the same in ADO. Preferrably with the command object.
table1 -- table on sql server
table2 -- table on sql server
* han -- valid handle to SQLserver
*SPT code
set multilocks on
cursorsetprop(0,"bufferring",5)
sqlexec(han,"begin transaction")
sqlexec(han,"select * from table1 with rowlock,updlock where table1_id = 'somevalue'","table1")
sqlexec(han,"select * from table2 with rowlock,updlock where table2_id = 'somevalue'","table2")
** make table1 and table2 updatable cursors
** modify the records.
if tableupdate(2,.t.,"table1") and tableupdate(2,.t.,"table2")
sqlexec(han,"if @@trancount > 0 Commit")
else
aerror(ernoupdates)
sqlexec(han,"if @@trancount > 0 Rollback")
tablerevert("table1")
tablerevert("table2")
endif
TIA
suhashegde
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only