Question transactions?

raysefo

Well-known member
Joined
Jul 21, 2010
Messages
207
Programming Experience
Beginner
Hi,

I have some db functions which insert and update some tables. Lets say when user enters data on a form and submit, this insert function runs and inserts it into table. Then another function is called and updates another table. What i want to do is, if the first transaction fails (insert) somehow then there is no sense to do the second transaction (update). How can i manage this?

thanks in advance.

Best Regards
 
If your update function runs immediately after your insert then just put them into a big IF... ELSEIF routine

i.e.
VB.NET:
IF {insert is successful} THEN
.... Your Update Function here
ELSE IF {insert fails} THEN
.... message to user "Insert failed.  Will not attempt to update Table XYZ"
END IF
 
Back
Top