Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rollback transactions

Status
Not open for further replies.

littlecat

Programmer
Joined
Jul 3, 2000
Messages
1
Location
US
Hi,<br><br>Can anyone please tell me how to do begin transaction, rollback transaction, and commit transaction in VBScript?&nbsp;&nbsp;I'm most uncertain about the syntax.<br><br>Thanks very much!!<br><br>~littlecat
 
<br>Hi Littlecat !<br><br>Well, I'm not sure if VBScript use the Connection object like Visual Basic, but for begin a Transaction in VB is necessary to have one instance of an object Connection<br><br>By example<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set myConn = CreateObject(ADODB.Connection)<br><br>At this moment we are access to the method<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myConn.BeginTrans<br><br>for begin the transaction<br><br>When we have maked that we want to do<br>&nbsp;( Acces to de Database, Update records, Delete Records,....)<br><br>if all is OK we will do<br><br>&nbsp;&nbsp;&nbsp;&nbsp;myConn.CommitTrans<br><br>for end the transaction. But if exists some errors or problems, we can make<br><br>&nbsp;&nbsp;&nbsp;myConn.RollbackTrans<br><br><br><br>I hope helped you.<br><br>Regards.<br><br>Jordi<br><br><br><br>&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top