Transaction control for VB6+SQL SERVER multi user concurrent information or mate

Transaction control for VB6+SQL SERVER multi user concurrent information or materials

Started by Edwiin at February 06, 2016 - 7:45 AM

private sub command1_click()
on error goto errhandle
conn.begintrans 'Begin transaction
conn.execute "insert into ..."
conn.execute "update tablename set ..."
conn.execute "delete from ..."
conn.committrans 'Commit transaction
exit sub
'Error handling
errhandle:
conn.rollbacktrans 'Error rollback transaction
msgbox "The operation failed, the cause of the error: "& err.description, 48," Tips"
exit sub
end sub

Posted by Everley at December 22, 2016 - 4:37 AM

How to prevent conflict.?

Posted by Edwiin at December 25, 2016 - 5:12 AM

For example: husband and wife (A) (B) in two bank outlets for their own home the only bank account management business,
1, A 5000 deposit first read the balance is 10000, then in 5000, the corresponding statement is "set =15000 update account balance sheet"
2, B took 3000 of the balance is 10000, then the withdrawal of 3000, the corresponding statement is "set =7000 update account balance sheet"

Eventually they account balance is 7000, which is obviously wrong, balance should be 12000, how to avoid this situation.?

Posted by Edwiin at December 28, 2016 - 5:18 AM

The problem is I really want to know how to solve, I have an idea, why to want to read.,
1.A deposits 5000 statement "update set = +5000 balance account balance sheet"
2.B 3000 statement "update set = -3000 balance account balance sheet"
Do not know do not update the balance, and then read out

Posted by Angelina at December 31, 2016 - 6:09 AM

Thank you, and the other answer

Posted by Edwiin at January 10, 2017 - 6:45 AM

1, Table set update account balance balanceļ¼‹5000 where
2, Table set update account balance balanceļ¼3000 where

Posted by Ignatz at January 14, 2017 - 6:25 AM