KeepLocal Property

See Also   Applies To

Sets or returns a value on a table, query, form, report, macro, or module that you do not want to replicate when the database is replicated (Microsoft Jet workspaces only).

Note Before getting or setting the KeepLocal property on a CdbDocument, CdbTableDef, or CdbQueryDef object, you must create it by using the CreateProperty method and append it to the Properties collection for the object.

Syntax

There is no member function to explicitly access this property. See Usage below for an example of how this property is managed.

Remarks

If you set this property to "T", the object will remain local when the database is replicated. You can't use the KeepLocal property on objects after they have been replicated.

Once you set the KeepLocal property, it will appear in the Properties collection for the object.

Before setting the KeepLocal property, you should check the value of the Replicable property.

After you make a database replicable, all new objects created within the Design Master, or in any other replicas in the set, are local objects. Local objects remain in the replica in which they're created and aren't copied throughout the replica set. Each time you make a new replica in the set, the new replica contains all the replicable objects from the source replica, but none of the local objects from the source replica.

If you create a new object in a replica and want to change it from local to replicable so that all users can use it, you can either create it in, or import it into, the Design Master. Be sure to delete the local object from any replicas; otherwise, you will encounter a design error. After the object is part of the Design Master, set the object's Replicable property to True.

The object on which you are setting the KeepLocal property might have already inherited that property from another object. However, the value set by the other object has no effect on the behavior of the object you want to keep local. You must explicitly set the property for each object.

Usage

...
CdbDBEngine      engine;
CdbProperty      prp;
CdbQueryDef      qdf;
COleVariant      vTrue(_T("T"));
...      
// Initialize engine, queryDef, etc.
prp = qdf.CreateProperty(
            _T("Replicable"), dbText, &vTrue);
qdf.Properties.Append( prp );
...
prp = qdf.Properties[_T("Replicable")];
if (prp.GetValue() == vTrue) 
   {
   prp = qdf.CreateProperty(
            _T("KeepLocal"), dbText, &vTrue);
   qdf.Properties.Append( prp );
   }
...