IDomainCredentials.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 domain user, from profile of which the connection is established, should be added to the list of repository users and has such privileges as Login and Right for Reading and Opening All Objects.

Add links to the Db and Metabase system assemblies.

Sub UserProc;
Var
    MbDef: IMetabaseDefinition;
    Package: ISecurityPackage;
    dc: IDomainCredentials;
    Mb: IMetabase;
    MbManager: IMetabaseManager;
    Table: ITable;
    Field: ITableField;
Begin
    Mb := Null;
    MbManager := MetabaseManagerFactory.Active;
    MbDef := MbManager.Definitions.FindById("MS");
    Debug.AssertMsg(MbDef <> Null"Repository description is not found");
    Package := MbManager.Packs.FindById(MbDef.SecurityPackage).Package;
    dc := Package.CreateCredentials(AuthenticationMode.Domain) As IDomainCredentials;
    dc.LogonAsCurrentUser := False;
    dc.Domain := "FORESIGHT";
    dc.UserName := EditBox1.Text;
    dc.Password := EditBox2.Text;
    Mb := MbDef.Open(dc, 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; ;

If the correct password and user name are entered, the connection to the MS schema is established, and the message about it is displayed. Names of table fields are displayed in a console window.

See also:

IDomainCredentials