>Can I use the adLockBatchOptimistic? if the user do want cancel something in the datagrid.
Because you use adLockBatchOptimistic, I can say that you use ADO.
The sure way to do what you want can be to use disconnected recordset (set rs.activeconnection = nothing). Then if the user want to update, you can reconnect your recordset and use the UpdateBatch method. But using this method, I see 2 bad things:
1. It will be all or nothing (all changed records or none of them).
2. Collisions may occur (someone else can modify the same record you had modified).
Why not simply have a grid, a couple of textboxes (and other input controls) with an OK and a Cancel button and update only when the user click the OK button?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com