<< Click to Display Table of Contents >>

Navigation:  Ado Classes > AdoRecordset Class >


Previous pageReturn to chapter overviewNext page


Refreshes the data in the current Recordset object from the underlying database.



METHOD Resync ( lAffectRecords AS USUAL, lResyncValues AS USUAL  )  AS VOID PASCAL CLASS AdoRecordSet



lAffectRecords        (Optional) An AffectEnum value that determines how many records the Resync method will affect.

lResyncValues        (Optional) A ResyncEnum value that specifies whether underlying values are overwritten.






Note        The table needs to have a primary key, or else Resync will fail !




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.

If you set the CursorLocation property to adUseClient, Resync is only available for non-read-only Recordset objects.

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.

If the Unique Table and Resync Command dynamic properties are set, and the Recordset is the result of executing a JOIN operation on multiple tables, then the Resync method will execute the command given in the Resync Command property only on the table named in the Unique Table property.



See Also

AdoRecordSet, AdoAffectEnum, AdoResyncEnum