Databases Reference
In-Depth Information
The Jet database engine defines built-in properties for its objects. For instance, a
TableDef object has a built-in Name property. In addition, Microsoft Access (and other
applications that may be using the Jet engine) can create application-defined properties .
For example, if you create a table in Microsoft Access and fill in the Description field in
the View...Properties dialog box, Access creates a Description property for the table and
appends it to the Properties collection for that TableDef object. Finally, as we will see
later, the user can create his own properties.
It is important to note that an application-defined property is created only if the user
assigns a value to that property. For example, if you do not specifically type a description
in the Description field, as discussed earlier, then Access will not create a Description
property. In other words, Access does not create a blank Description property. If you then
use this property in your code, an error will result. Thus, when you write programs that
refer to either application-defined or user-defined properties, it is important to check for
errors, in case the referenced property does not exist.
Of course, each Property object, being an object, has its own properties, but you will be
glad to hear that these properties do not have Property objects. (Where would this end?)
We should also mention that properties can be classified as read/write, read-only, or
write-only . A read/write property can be both read and written to (i.e., changed), whereas
a read-only property can be read but not changed, and a write-only property can be
changed but not read. When an object is first created, its read/write properties can be set.
However, in many cases, once the object is appended to a collection, some of these
properties may become read-only and can therefore no longer be changed.
The properties of a Property object are described as follows. A Property object has no
methods.
14.6.2.1 Property: Inherited
For the built-in Property objects, this value is always 0 (False). For user-defined
properties, this value is true if the property exists because it was inherited from another
object. For instance, any Recordset object that is created from a QueryDef object inherits
the QueryDef 's properties.
14.6.2.2 Property: Name
The usual Name property, which in this case is the name of the property represented by
this Property object.
14.6.2.3 Property: Type
This value gives the data type of the object. Note that the Type property is read/write
until the Property object is appended to a Properties collection, after which it becomes
read-only. The value of the Type property is an integer. VBA provides built-in constants
Search WWH ::




Custom Search