Databases Reference
In-Depth Information
TableDefs!BOOKS
This object is contained in the TableDefs collection for the Database object named:
Databases![d:\dbase\library.mdb]
This object is, in turn, contained in the Databases collection of the default Workspace
object (more on this later), which is:
Workspaces(0)
which, in turn, is contained in the DBEngine object. Separating each of these object
names by the dot operator gives the fully qualified object name.
In general, the syntax for a semiqualified object name is:
Collection!Object
and for a fully qualified object name, it is:
DBEngine.Collection1!Object1. · · · .CollectionN!ObjectN
There seems to be much confusion over when to use the bang operator ( ! ) and when to
use the dot operator ( . ). Perhaps the following will help:
The bang operator is used to separate an object's name from the name of the
collection of which it is a member. In other words, bang signifies a member of a
collection. It therefore appears in semiqualified object names.
The dot operator is used to separate each semiqualified object name in a fully
qualified object name. In other words, it signifies the next step in the hierarchy.
The dot operator is also used to denote a property or method of an object.
This naming convention is really not as confusing as it may look at first, if you remember
the previous three maxims. However, if you want confusing, stay tuned for default
collections.
14.4.2 Using Object Variables to Your Advantage
As you can see, a fully qualified object name can be quite lengthy. This problem is
compounded by the fact that it may be necessary to refer to the same object many times
in a program. There are two common ways to deal with this issue.
One way is to use object variables. Consider the code in Example 14-3 to display the
RecordCount property of the BOOKS table.
Search WWH ::




Custom Search