Applies To Database object.
Description
Synchronizes any changes in a partial replica with the full replica, clears all records in the partial replica, and then repopulates the partial replica based on the current replica filters. (Microsoft Jet databases only.)
Syntax database.PopulatePartial dbname The PopulatePartial method syntax has the following parts.Part | Description |
database | An object variable that references the partial replica Database object that you want to populate. |
dbname | A string specifying the path and name of the full replica from which to populate records. |
Remarks When you synchronize a partial replica with a full replica, it is possible to create "orphaned" records in the partial replica. For example, suppose you have a Customers table with its ReplicaFilter set to "Region = 'CA'". If a user changes a customer's region from CA to NY in the partial replica, and then a synchronization occurs via the Synchronize method, the change is propagated to the full replica but the record containing NY in the partial replica is orphaned because it now doesn't meet the replica filter criteria.
To solve the problem of orphaned records, you can use the PopulatePartial method. The PopulatePartial method is similar to the Synchronize method, but it synchronizes any changes with the full replica, removes all records in the partial replica, and then repopulates the partial replica based on the current replica filters. Even if your replica filters have not changed, PopulatePartial will always clear all records in the partial replica and repopulate it based on the current filters. Generally, you should use the PopulatePartial method when you create a partial replica and whenever you change your replica filters. If your application changes replica filters, you should follow these steps:See Also Synchronize method.
Example The following example uses the PopulatePartial method after changing a replica filter.Sub PopulatePartialX()
Dim tdfCustomers As TableDef
Dim strFilter As String
Dim dbsTemp As Database
' Open the partial replica in exclusive mode.
Set dbsTemp = OpenDatabase("F:\Sales\Fy96ca.mdb", True)
With dbsTemp
Set tdfCustomers = .TableDefs("Customers")
' Synchronize with full replica
' before setting replica filter.
.Synchronize "C:\Sales\Fy96.mdb"
strFilter = "Region = 'CA'"
tdfCustomers.ReplicaFilter = strFilter
' Populate records from the full replica.
.PopulatePartial "C:\Sales\Fy96.mdb"
.Close
End With
End Sub