Replicated databases make extensive use of temporary space, especially when many design changes are made to an application. Just as with non-replicated databases, compacting regularly reduces file size and improves performance.
For optimal results, compact a replicated database twice. Compacting a replica the first time reclaims some space and flags other space as available for reclaiming later. Compacting a second time reclaims all available space. Compacting more than twice doesn’t provide additional benefits.
When Microsoft Jet opens a replica, it stores the name and location of the file in the database. The next time Microsoft Jet opens the replica, it checks to see if the file has the same name and location. If so, then the file opens normally. If not, Microsoft Jet gives the replica a new ReplicaID property value and it will be treated as an additional replica in the replica set. Additionally, if the file was the Design Master, Microsoft Jet removes the Design Master flag. This prevents two replicas from having the same ReplicaID property value and keeps a replica set from having two Design Masters.
To prevent this, when using the CompactDatabase method with a replicated database, make sure your code renames the new compacted .mdb file to the original file name before opening it.