ACC: How to Find Out If Replica Is the Design Master

Last reviewed: August 28, 1997
Article ID: Q138845
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SUMMARY

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

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.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.

MORE INFORMATION

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

  1. Create a module and type the following line in the Declarations section if it is not already there:

          Option Explicit
    

  2. 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 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
    
    

  3. To test this function, type the following line in the Debug window, and then press ENTER.

           ? IsDesignMaster()
    

    Note that either Null, True, or False is returned.

REFERENCES

For more information about DesignMasterID, ReplicaID, and other replication related properties, search the Help Index for "properties, replica" or ask the Microsoft Access 97 Office Assistant.

Keywords          : kbusage PgmHowTo
Version           : 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.