Class Containers (DAO VBA)

A Containers collection contains all of the Container objects that are defined in a database. To use a Containers class variable it first needs to be instantiated, for example


Dim cnts as Containers
Set cnts = Workspaces(1).Databases(1).Containers

Count

Returns the number of Connection objects in the Connections collection.

Because members of a collection begin with 0, you should always code loops starting with the 0 member and ending with the value of the Count property minus 1. If you want to loop through the members of a collection without checking the Count property, you can use a For Each...Next command. The Count property setting is never Null. If its value is 0, there are no objects in the collection.


Dim cnts As DAO.Containers: Set cnts = 
cnts.Count

Item

Item (Item)

Refresh

Not supported for the Connections collection.


Dim cnts As DAO.Containers: Set cnts = 
cnts.Refresh