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

Editing Data

To edit the data in a recordset or to add new records, several conditions must be met. On one hand, the recordset on which the query is based must return a modifiable resultset; that is, it cannot contain an aggregate function such as Max() or Sum(). On the other hand, you must open the recordset with the lock method adLockOptimistic (or adLockBatchOptimistic; see the section later in this chapter entitled “Batch Processing”). If you are not using the CurrentObject.Connection connection object, and if you are creating a connection object with the SQLOLEDB provider instead, you can also use the adLockPessimistic option. See Chapter 26, “Transactions and Locking,” for a description of the locking mechanisms.

If you want to edit the data in the recordset, Supports(adEdit) must return the value True. You can add new records if Supports(adAddNew) is True.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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