How to rollback transaction in classic asp Page

Posted by Alok under Others on 5/2/2016 | Points: 10 | Views : 1025 | Status : [Member] | Replies : 1
i have used transaction as
 <%@transaction=required%>

in my classic asp page.


My question is to how to rollback transaction if any i got any error on page level in classic asp.

Please reply .

Thanks & Regards,
Alokssm



Responses

Posted by: Bhuvanesh6 on: 7/25/2016 [Member] Starter | Points: 25

Up
0
Down
Methods

SetAbort : Aborts the transaction initiated by the ASP script.

SetComplete : Declares that there is no reason for the transaction not to complete. So if all the components taking part in the transaction also call SetComplete method then the transaction will complete.

Events

OnTransactionAbort : This event occurs when the transaction is aborted.

OnTransactionCommit: This event occurs when the transactional script's transaction is committed.



Code to Commit or Abort:

<%

'commit and rollback code
sub OnTransactionCommit()
Response.write("Operation was successful")
End Sub
sub OnTransactionAbort()
Response.write("Operation was unsuccessful")
End Sub
%>



Ref: http://classical-asp.blogspot.in/2010/09/asp-transactions.html

Bhuvan

Alok, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response