• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 30. Working with ADO Recordsets,... > Modifying Rows of Recordsets

Modifying Rows of Recordsets

You can perform CRUD (Create, Read, Update, and Delete) operations on most dynamic Recordsets with VBA code. To test whether a Recordset is updatable (editable), check the return value of the rstName.Supports(adUpdate) expression, which replaces DAO.Recordset's Updatable property. You can't edit forward-only Recordsets, and most dynamic queries with INNER or OUTER JOINs aren't editable.

Editing and Adding Rows

Unlike DAO.Recordset objects, which are updatable by default, ADODB.Recordsets default to read-only locking. To make an ADODB.Recordset updatable, you must set the LockEdits property of the Recordset to adLockOptimistic (the most common choice), adLockPessimistic, or adLockBatchOptimistic. Before performing the tests for updatability, do the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint