IDalConnectionDescriptorExt.CreateConnectionExt

Syntax

CreateConnectionExt(AllowPasswordExpiredConection: Boolean): IDalConnection;

Parameters

AllowPasswordExpiredConection. It determines if the connection will be established, if password expired. The True value allows to connect if the passwords expired, the False value forbids to connect.

Description

The CreateConnectionExt method returns the error or creates a connection with the database server, if the user password expired. If the value of the AllowPasswordExpiredConection parameter is True, the connection is created, if the error occurs, if the value is False, the error is returned.

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:

IDalConnectionDescriptorExt