SQL Server transactions in ASP code

100 pts.
Tags:
ASP
SQL Server
SQL Server transaction logs
Can we create sql server transactions in asp, if so how can we manage transactions in asp. Please suggest me, how to do it.

Answer Wiki

Thanks. We'll let you know when a new response is added.

First you will need to have DTC setup and working on the web server and the SQL Server. Without DTC working you won’t be able to start a transaction on the web server and have it continue to the SQL Server.

This site covers the basics of handling a transaction.

The ConnectionObject.BeginTrans and ConnectionObject.Endtrans can be used for managing the SQLSERVER transactions in asp code. And if everything is fine, to commit the transaction use ConnectionObject.CommitTrans, otherwise, to rollback the operations use ConnectionObject.RollbackTrans.
To be able to use one transaction for more than one SQL statement, set the RecordSetObject.CursorType to adOpenDynamictype

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,130 pointsBadges:
    report
  • Vini Chandamama
    Mrdenny thanks for the answer. I got the solution from the link given by you. And I set the Record Set object's CursorType to adOpenDynamictype. So now I am able to use only one transaction for more than one SQL statement.
    100 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following