Description

Activate Security on this McDBDatabase.

Return Type

None  

Syntax

object.EnableSecurity AdministratorPassword

The EnableSecurity Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBDatabase.
AdministratorPasswordRequired. A String value.

The string password for the only McDBUser login created by this method (Administrator). This call also creates the global McDBGroup instances (e.g. Administrators). However, no other users are created. Therefore, after this call, the Administrator account is the only valid login for this McDBDatabase.

Remarks

This method activates security on this McDBDatabase. Subsequent attempts to open this McDBDatabase will require negotiation of a username and password, which will establish login credentials and access rights, as defined by the McDBLib Security API.

Exceptions

Error Value Description
E_FAIL &H80004005 A miscellaneous framework error occurred while securing this McDBDatabase.
E_ACCESSDENIED &H80070005 The Database was opened Read Only.
E_INVALIDARG &H80070057 No password was supplied.
CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT &H80004024 This McDBDatabase cannot be opened for exclusive access.
E_UNEXPECTED &H8001FFFF A severe framework error occurred while creating the default groups and rights in this McDBDatabase.

Notes

Since McDBDatabase instances are never opened more than once, this method has no impact until this McDBDatabase is closed (released) by all of its users. Further, this McDBDatabase MUST BE OPEN when this method is called. Following this call, the database will be left OPEN and the logged account will be the Administrator. The following McDBGroup objects are automatically defined:

 Guests: Read Only access to unsecure objects.
 Power Users: Full access to unsecure objects.
 Administrators: Full access to unsecure objects and
    McDBRightsOwner.ObjectTypeAdminRight, McDBRightsOwner.AttributeTypeAdminRight,
    and McDBRightsOwner.IsAdministrator