Microsoft KB Archive/138974

= ACC95: Cannot Create Relationship with Local and Replicated Tables =

Article ID: 138974

Article Last Modified on 11/17/2000

-

APPLIES TO


 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q138974



SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.

When you try to create a relationship between two tables in a replicated database, you may receive the following error message:

You can't establish or maintain a relationship between a replicated table and local table.



CAUSE
Microsoft Jet Replication does not allow you to create a relationship between two tables if the following conditions are true:


 * One table is replicated and the second is local. (That is, the second table is not replicated; therefore, it is not dispersed throughout the replica set.)
 * The two tables are local and related (through referential integrity) when you try to turn on the Replicable property for one of the tables.
 * The two tables have different KeepLocal property settings.



RESOLUTION
If one table is replicated and the second is local, turn off the Replicable property of the replicated table. Then, you can try to create the relationship between the two local tables.

If two tables are local and related, when you try setting the Replicable property, delete the relationship first. Then, try to turn on the Replicable property for the two local tables.

If the two tables have different KeepLocal property settings, modify one table's KeepLocal property so that it is the same as the setting in other table. Then, try to create the relationship.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 In Windows Explorer, make a copy of the sample database Northwind.mdb and name it Test.mdb. Start Microsoft Access and open the Test.mdb. On the Tools menu, point to Replication, and then click Create Replica. In the "This database must be closed before you can create a replica" box, click Yes. In the "Microsoft Access can make a backup of your database before converting it to a Design Master" box, click Yes.</li> In the Location of New Replica box, select the same folder location as the Test.mdb database. In the File Name box, type TestReplica.mdb .</li> Click OK to create the replica.</li> In the Design Master database (Test.mdb) make a copy of the Customers table and name it Cust1.</li> On the Tools menu, click Relationships.</li> On the Relationships menu, click Show Table.</li> In the Show Table box, select Cust1. Click Add, and then click Close.</li> Drag the CustomerID field from the Cust1 table to the CustomerID field in Customers table.</li> In the Relationships box, select Enforce Referential Integrity, and then click Create. Note that you receive the following error message:

You can't establish or maintain a relationship between a replicated table and local table.

</li></ol>

<div class="references_section">