Refreshes the data in the current Recordset object from the underlying database.
Syntax
recordset.Resync AffectRecords, ResyncValues
Parameters
AffectRecords Optional. An AffectEnum value that determines how many records the Resync method will affect. Can be one of the following constants.
Constant | Description |
adAffectCurrent | Refresh only the current record. |
adAffectGroup | Refresh the records that satisfy the current Filter property setting. You must set the Filter property to one of the valid predefined constants in order to use this option. |
adAffectAll | Default. Refresh all the records in the Recordset object, including any hidden by the current Filter property setting. |
ResyncValues Optional. A ResyncEnum value that specifies whether underlying values are overwritten. Can be one of the following constants.
Constant | Description |
adResyncAllValues | Default. Data is overwritten, and pending updates are canceled. |
adResyncUnderlyingValues | Data is not overwritten, and pending updates are not canceled. |
Remarks
Use the Resync method to resynchronize records in the current Recordset with the underlying database. This is useful if you are using either a static or forward-only cursor but you want to see any changes in the underlying database.
Unlike the Requery method, the Resync method does not re-execute the Recordset object's underlying command; new records in the underlying database will not be visible.
If the attempt to resynchronize fails because of a conflict with the underlying data (for example, a record has been deleted by another user), the provider returns warnings to the Errors collection and a run-time error occurs. Use the Filter property (adFilterConflictingRecords) and the Status property to locate records with conflicts.
Remote Data Service Usage The Resync method is not available on a client-side Recordset.