How To Navigate an ADO Recordset without Saving Changes to Current Record (228451)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q228451 SUMMARY
You are developing an application with Visual Basic and ADO that allows users to view and edit records in a database. The user navigates to a particular record, makes a change, and then tries to move to another record. In response, your application prompts the user: "Do you want to save the changes you made to the current record?" If the user answers "No," then you want to cancel the update and continue with the requested navigation.
The default behavior in ADO is that any changes to a record are saved when moving to another record. If the update fails or is canceled, the move operation is canceled. The below example illustrates how to implement the desired behavior.
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbDatabase kbDataBinding kbhowto KB228451 |
---|
|