ACC: How to Find Out If Replica Is the Design MasterID: Q138845
|
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.
To determine if a database is the Design Master, follow these steps:
Option Explicit
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
? IsDesignMaster()Note that either Null, True, or False is returned.
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.
Additional query words:
Keywords : kbusage kbdta AccCon KbVBA
Version : WINDOWS:7.0,97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: August 2, 1999