Synchronize Method (JRO)

Jet Replication Objects

Synchronize Method

       

Synchronizes two replicas.

Syntax

Replica.Synchronize(Target [, SyncType] [, SyncMode])

Parameters

Target   A String value specifying the path and file name of the replica with which to synchronize, the name of the Synchronizer that manages the target replica, or the name of the Internet server that contains the target replica.

SyncType   Optional. An Enum value specifying the type of synchronization to perform. The default value for the SyncType parameter is jrSyncTypeImpExp. The following values are valid for SyncType:

Constant Description
jrSyncTypeExport Sends changes from the current replica to the target replica.
jrSyncTypeImport Sends changes from the target replica to the current replica.
jrSyncTypeImpExp Default. Sends changes from the current replica to the target replica and vice-versa.

SyncMode   Optional. An Enum value specifying the method of synchronization. jrSyncModeIndirect is the default value for the SyncMode parameter. The following values are valid for SyncMode:

Constant Description
jrSyncModeIndirect Default. Indirect synchronization.
jrSyncModeDirect Direct synchronization.
jrSyncModeInternet Indirect synchronization over the Internet.

Remarks

The replica identified in Target parameter must be part of the same replica set. If both replicas have the same ReplicaId property setting or are design masters for two different replica sets, the synchronization fails. This is enforced by the provider.

When the SyncMode is indirect, the value of the Target parameter must be a Synchronizer name. Jet Replication leaves the changes in a "dropbox." The Synchronizer that manages that target replica picks up the changes and applies them. For indirect synchronization to work correctly, a Synchronizer must be running on both the local computer and the target computer.

When the SyncMode is Internet, the value of the Target parameter must be a Universal Resource Locator (URL) address instead of a local area network path. An error will occur if a URL is specified in the Target parameter and the SyncMode parameter is not jrSyncModeInternet.

When the SyncMode is direct, both replicas are opened simultaneously and synchronized. Over a WAN or remote dialup network, reliability and performance are improved by using indirect synchronization. You can also synchronize with an SQL Server replica in a replica set containing both SQL Server and Jet databases by setting the Target parameter to ServerName.Database.Publication and performing a direct (jrSyncModeDirect) synchronization. An error will occur if the Target parameter is ServerName.Database.Publication and SyncMode is other than direct.

This method can only be used if the database is replicable. An error will occur if the ReplicaType is jrRepTypeNotReplicable and the user attempts to use this method.

Replication Manager is required for installation and configuration of the Synchronizer and Replman should be used to monitor the status for indirect and Internet synchronizations. It is only available in the Microsoft Office 2000, Developer Edition. For more information about Replication Manager, see Replication Manager in Microsoft Access help.