Verifying the Options That a Recordset Supports

Check which options a specific recordset supports by using the Supports method. The method returns True if the option is supported, and False if not . The following table lists the options you can test for.

With this constant . . .

You can do this . . .

AdAddNew

Use the AddNew method to add records.

AdApproxPosition

Use the AbsolutePosition and AbsolutePage properties.

AdBookmark

Use the Bookmark property.

AdDelete

Use the Delete method to delete records.

AdFind

Use the Find method to locate a specific record.

AdHoldRecords

Move the cursor position without committing any changes to the current record.

AdIndex

Use the Index property to set an index.

AdMovePrevious

Use the MoveFirst, MovePrevious, and Move methods to move the cursor position backwards.

AdResync

Use the Resync method to resynchronize the recordset with its underlying data.

AdSeek

Use the Seek method to locate a specific record.

AdUpdate

Use the Update method to commit changes to the current record.

AdUpdateBatch

Use the UpdateBatch and CancelBatch methods.

A typical example of how to test for, say, AbsolutePosition functionality is as follows:

booResult = rs.Supports(adApproxPosition) MsgBox "This recordset does" & _

IIf(booResult = True,"", "not") & _ "support AbsolutePosition and AbsolutePage"

0 0

Post a comment