ACC95: User-Defined Database Properties Are ReplicatedID: Q139043
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
The Properties collection of an object is replicated on all databases
making up the replication set. This includes any user-defined properties
that you add to an object or collection in Microsoft Access version 7.0.
Every data access object contains a Properties collection, which has
certain built-in Property objects. These Property objects (which are often
just called properties) uniquely characterize that instance of the object.
In addition to the built-in properties, some objects allow you to create
and add your own user-defined properties.
You can use database replication to maintain synchronized copies of a
database (or replica) either on the same computer or on different computers
with different users over a network. When you replicate a database, you
create a replica set consisting of the original database and at least one
replica that is identical to the original. Each replica and Design Master
is capable of creating and manipulating user-defined properties that will
be properly synchronized with all databases in the replica set.
There are two methods for adding user-defined properties to a database: you
can use the Microsoft Access user interface; or you can use Visual Basic
for Applications code.
Option Explicit
Function TestCustomProperty() As Boolean
On Local Error GoTo TestCustomPropertyErr
Dim dbs As Database, cnt As Container
Dim doc As Document, prp As Property
' Define Database object, Container and Document.
Set dbs = CurrentDb()
Set cnt = dbs.Containers!Databases
Set doc = cnt.Documents!UserDefined
' Refresh the Document object.
doc.Properties.Refresh
Set prp = dbs.CreateProperty("MyProp", dbText, "Test")
doc.Properties.Append prp
TestCustomProperty = True
MsgBox "Created Custom Property [MyProp=Test]"
TestCustomPropertyEnd:
Exit Function
TestCustomPropertyErr:
MsgBox Error$
Resume TestCustomPropertyEnd
End Function
? TestCustomProperty()
For more information about Properties, search on the phrase "Property
Collection," and then view any relevant topics using the Answer Wizard
from the Microsoft Access 7.0 Help menu.
For more information about Replication, search on the phrase "Briefcase
Replication," and then view any relevant topics using the Answer Wizard
from the Microsoft Access 7.0 Help menu.
Keywords : kbusage RplGen
Version : 7.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: May 3, 1999