DAO Object
 
Container object groups similar types of Document objects together.
 

Remarks

Each Database object has a Containers collection consisting of built-in Container objects. Applications can define their own document types and corresponding containers (Microsoft Access database engine databases only); however, these objects may not always be supported through DAO.
 
Some of these Container objects are defined by the Microsoft Access database engine while others may be defined by other applications. The following table lists the name of each Container object defined by the Microsoft Access database engine and what type of information it contains.
Container name
Contains information about
Databases
Saved databases
Tables
Saved tables and queries
Relations
Saved relationships
 
 Note
Don't confuse the Container objects listed in the preceding table with the collections of the same name. The Databases Container object refers to all saved database objects, but the Databases collection refers only to database objects that are open in a particular workspace.
 
Each Container object has a Documents collection containing Document objects that describe instances of built-in objects of the type specified by the Container. You typically use a Container object as an intermediate link to the information in the Document object. You can also use the Containers collection to set security for all Document objects of a given type.
With an existing Container object, you can:
 
Because Container objects are built-in, you can't create new Container objects or delete existing ones.
To refer to a Container object in a collection by its ordinal number or by its Name property setting, use any of the following syntax forms:
 

Properties

Name
Description

Returns a Documents collection that contains all of the documents stored in the specified object. Read-only.

Returns the name of the specified object. Read-only String.


Returns the Properties collection of the specified object. Read-only.

 

Example

 
This example enumerates the Containers collection of the Northwind database and the Properties collection of each Container object in the collection.
 
Sub ContainerObjectX()
    
     Dim dbsNorthwind As Database
     Dim ctrLoop As Container
     Dim prpLoop As Property
    
     Set dbsNorthwind = OpenDatabase("Northwind.mdb")
    
     With dbsNorthwind
    
     ' Enumerate Containers collection.
     For Each ctrLoop In .Containers
     Debug.Print "Properties of " & ctrLoop.Name _
     & " container"
    
     ' Enumerate Properties collection of each
     ' Container object.
     For Each prpLoop In ctrLoop.Properties
     Debug.Print " " & prpLoop.Name _
     & " = " prpLoop
     Next prpLoop
    
     Next ctrLoop
    
     .Close
     End With
    
    End Sub