Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Find Out If a Replica Is the Design Master


View products that this article applies to.

This article was previously published under Q210224
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access database (.mdb).

↑ Back to the top


Summary

Microsoft Jet Replication does not have a property that specifies whether a replica is the Design Master of a replica set. However, this article demonstrates how you can use Visual Basic for Applications to determine if a database is the Design Master.

↑ Back to the top


More information

To determine if a database is the Design Master, follow these steps:

  1. Create a module, and then type the following line in the Declarations section if it is not already there:
    Option Explicit
    					
  2. On the Tools menu, click References.
  3. Add the Microsoft DAO 3.6 Object Library.
  4. Type the following procedure:
    Function IsDesignMaster()
    
       ' This function determines if the current database is
       ' the Design Master and returns True if the current
       ' database is the Design Master and returns False if
       ' the current database is not the Design Master. The
       ' function returns Null if the database is not a
       ' replicable database.
    
       Dim db As DAO.Database
    
       Set db = CurrentDb()
    
       If db.DesignMasterID = db.ReplicaID Then
          If db.ReplicaID = "" Then ' Check to see if db is replicable.
             IsDesignMaster = Null
          Else
             IsDesignMaster = True
          End If
       Else
          IsDesignMaster = False
       End If
    
    End Function
    					
  5. To test this function, type the following line in the Immediate window, and then press ENTER:
    ? IsDesignMaster()
    						
    Note that either Null, True, or False is returned.

↑ Back to the top


Keywords: KB210224, kbusage, kbhowto

↑ Back to the top

Article Info
Article ID : 210224
Revision : 2
Created on : 6/24/2004
Published on : 6/24/2004
Exists online : False
Views : 324