Microsoft KB Archive/192717

= PRB: RollbackTrans Does Not Undo Changes to ADO Recordset =

Article ID: 192717

Article Last Modified on 8/12/2005

-

APPLIES TO


 * Microsoft ActiveX Data Objects 1.5
 * Microsoft ActiveX Data Objects 2.0
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.7
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Studio 6.0 Enterprise Edition
 * Microsoft Visual Studio 97 Service Pack 3

-



This article was previously published under Q192717



SYMPTOMS
Calling a RollbackTrans on an ActiveX Data Objects (ADO) connection object does not undo the changes made to a client-side ADO recordset object that uses that connection.



STATUS
This behavior is by design.



MORE INFORMATION
The easiest way to revert your recordset is to persist the recordset in the desired state using the Save method that was introduced in ADO version 2.0. For example: rsAuthors.CursorLocation = adUseClient rsAuthors.Open "SELECT Au_ID, Au_LName FROM Authors", cnPubs, _ adOpenStatic, adLockBatchOptimistic, adCmdText rsAuthors.Save strPath cnPubs.BeginTrans rsAuthors!Au_LName = InputBox("Enter a new last name") rsAuthors.Update rsAuthors.UpdateBatch cnPubs.RollbackTrans rsAuthors.Open Source:=strPath, LockType:=adLockBatchOptimistic, _ Options:=adCmdFile Set rsAuthors.ActiveConnection = Nothing Set rsAuthors.ActiveConnection = cnPubs Another possible solution is to use the Resync or Requery commands on the recordset object to retrieve the most up to date information from the database.

Keywords: kbprb KB192717

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.