Owner Property

Applies To

Container object, Document object.

Description

Sets or returns a value that specifies the owner of the object (Microsoft Jet workspaces only).

Settings and Return Values

The setting or return value is a String that evaluates to either the name of a User object in the Users collection or the name of a Group object in the Groups collection.

Remarks

The owner of an object has certain access privileges denied to other users. Any individual user account (represented by a User object) or group of user accounts (represented by a Group object) can change the Owner property setting at any time if it has the appropriate permissions.

See Also

Permissions property, User object.

Example

This example uses the Owner and SystemDB properties to show the owners of a variety of Document objects.

Sub OwnerX()

    ' Ensure that the Microsoft Jet workgroup file is
    ' available.
    DBEngine.SystemDB = "system.mdw"

    Dim dbsNorthwind As Database
    Dim ctrLoop As Container

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")

    With dbsNorthwind
        Debug.Print "Document owners:"
        ' Enumerate Containers collection and show the owner
        ' of the first Document in each container's Documents
        ' collection.
        For Each ctrLoop In .Containers
            With ctrLoop
                Debug.Print "    [" & .Documents(0).Name & _
                    "] in [" & .Name & _
                    "] container owned by [" & _
                    .Documents(0).Owner & "]"
            End With
        Next ctrLoop

        .Close
    End With

End Sub