IPasswordCredentials.Password

Syntax

Password: String;

Description

The Password property determines the user password that is used for connection.

Example

Executing the example requires EditBox1 and EditBox2 of EditBox type on the form. The schema must contain a table with the Table identifier. The user, from whose account the connection is established, has to be added to a list of repository users and has to get the "Entering the system" and the "Right for reading and opening all objects".

Sub UserProc;

Var

MbDef: IMetabaseDefinition;

Package: ISecurityPackage;

PC: IPasswordCredentials;

Mb: IMetabase;

MbManager: IMetabaseManager;

Table : ITable;

Field : ITableField;

Begin

Mb := Null;

MbManager := MetabaseManagerFactory.Active;

MbDef := MbManager.Definitions.FindById("p5bash");

Debug.AssertMsg(MbDef <> Null, "Metabase description is not found");

Package := MbManager.Packs.FindById(MbDef.SecurityPackage).Package;

PC := Package.CreateCredentials(AuthenticationMode.Password) As IPasswordCredentials;

PC.UserName := EditBox1.Text;

PC.Password := EditBox2.Text;

Mb := MbDef.Open(PC,ApplicationMode.Win,LocaleCodeID.Russian);

WinApplication.InformationBox(Connection is established);

Table := Mb.ItemById ("Table").Bind As ITable;

For Each Field In Table.Fields Do

Debug.WriteLine(Field.Name);

End For;

End Sub UserProc;

When specifying correct user password and name connection to the "p5bash" scheme is established, a message about it is displayed. Names of table fields are displayed in a console window.

See also:

IPasswordCredentials