IDalConnectionExt.ChangeExpiredPassword

Syntax

ChangeExpiredPassword(NewPassword: String);

Parameters

NewPassword is a new password.

Description

The ChangeExpiredPassword method changes the user password for specified one in the parameter.

Comments

The password repository policy (IMetabasePasswordPolicy) is not checked during this change, the prohibition to change a password by user (IMetabaseUser.CannotChangePassword) is not checked either. If the password was changed successfully and connection to the repository was established, the appropriate record was done in the access protocol, if the password was not changed successfully, the appropriate exception with the details represented as DBMS error was generated. If the previous user password was encrypted, new password would be encrypted too after changing.

Example

Sub UserProc;

Var

MB: IMetabase;

Driv: IDalDriver;

ConnectDesc: IDalConnectionDescriptor;

ConnectDescParams: IDalConnectionDescriptorParams;

connection_ext : IDalConnectionExt;

connection_ext_desc: IDalConnectionDescriptorExt;

dal_con :IDalConnection;

Begin

MB := MetabaseClass.Active;

Driv := New DalOrcl8Driver.Create;

ConnectDesc := Driv.CreateDescriptor;

ConnectDescParams := ConnectDesc.Params;

ConnectDescParams.Find("User Name").Value := "student_p5";

ConnectDescParams.Find("Password").Value := "student_p5";

ConnectDescParams.Find("Host BSTR").Value := "test";

ConnectDescParams.Find("Schema").Value := "student_p5";

connection_ext_desc := ConnectDesc As IDalConnectionDescriptorExt;

dal_con := connection_ext_desc.CreateConnectionExt(True);

connection_ext := dal_con As IDalConnectionExt;

If connection_ext.PasswordExpired Then

connection_ext.ChangeExpiredPassword("student00");

End If;

End Sub UserProc;

Connection to the database is created after executing this example. If the password expired, it would be changed.

See also:

IDalConnectionExt