MakeReplica Method

      Applies To

Makes a new replica from another database replica (Microsoft Jet workspaces only).

Syntax

VOIDMakeReplica(LPCTSTR pstrPath,

LPCTSTR pstrDescription,

LONG lOptions = -1);

Parameters

Type Argument Description
LPCTSTR pstrPath A pointer to a string that contains the path and file name of the new replica. If the replica is an existing file name, then an error occurs.
LPCTSTR pstrDescription A pointer to a string that describes the replica you are creating.
LONG lOptions Optional. A constant or combination of constants that specifies characteristics of the replica you are creating, as specified in Settings.

Settings

You can use one or more of the following constants for lOptions.

Constant Description
dbRepMakePartial Creates a partial replica.
dbRepMakeReadOnly Prevents users from modifying the replicable objects of the new replica; however, when you synchronize the new replica with another member of the replica set, design and data changes will be propagated to the new replica.

Remarks

A newly created partial replica will have all ReplicaFilter properties set to False, meaning that no data will be in the tables.

Usage

#include <afxole.h>
#include <dbdao.h>

CdbDBEngin   dben;
CdbDatabase   db;
...                        // Initialize db, etc.
db = dben.OpenDatabase(_T("OriginalReplica.mdb"));
db.MakeReplica(_T("NewReplica.mdb"),
               _T("Copy of OriginalReplica.mdb"),
               dbRepMakeReadOnly);