Let me back up.
DAO naming is hierarchical in nature, sort of like the DOS path. And like DOS, you can refer to an object using a fully qualified name or a semi-qualified name. In DOS, a fully qualified name would be like this:
C:\MSOFFICE\ACCESS\TEST.MDB
If you are already in a folder, you can refer to the file by its semi-qualified name:
TEST.MDB In the same way, you can refer to an Access object by its fully qualified name:
DBEngine.Workspaces(0).Databases! _
[c:\msoffice\access\test.mdb].TableDefs!Table1
or if you assume the default DBEngine (which we almost always do), the default Workspace, and default Database, you can refer to the table by its semi-qualified name:
If you look at the fully qualified name like this:
DBEngine.
Workspaces(0).
Databases![c:\msoffice\access\test.mdb].
TableDefs!Table1
The dot also serves to separate an object from its properties and methods, which can also be thought of as another level in the hierarchy. So I can refer to "TableDefs!Table1.RecordCount". RecordCount being a property of Table1.
The bang (!) separates objects from the collections which hold them, thus it separates "Table1" from the collection "TableDefs" and the object "c:\msoffice\access97\test.mdb" from its collection "Databases".
DAO Naming Rules:
- The dot serves to separate one level of the DAO hierarchy from another in a fully qualified object name.
- The dot also serves to separate an object from its methods and properties. (This, by the way, is the principle use for most people).
- The bang serves to separate an object from the collection in which it is contained.
No comments:
Post a Comment