Description

The password of an McUser cannot be retrieved, but may be assigned, if the old password can be provided and the user has sufficient access rights. This method allows the password of this McDBUser to be assigned in this manner.

Return Type

None  

Syntax

object.SetPassword OldPassword, NewPassword

The SetPassword Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBUser.
OldPasswordRequired. A String value.

The current password of this McDBUser

NewPasswordRequired. A String value.

The password to assign to this McDBUser

Remarks

McDBUser.SetPassword()

A McDBUser is always allowed to change their own password, provided they know their current password. Otherwise, only Administrators (McDBRightsOwner.IsAdministrator is True) can assign a password. In this case, the OldPassword is not needed.

Exceptions

Error Value Description
E_ACCESSDENIED &H80070005 Insufficient security privilege to assign the password. Either the McDBDatabase.LoggedUser is not the McDBUser whose password is being assigned or the McDBDatabase.LoggedUser does not have Administration privileges (McDBRightsOwner.IsAdministrator).
E_UNEXPECTED &H8001FFFF A framework error occurred while attempting to assign the requested password to this McDBUser.