IDomainCredentials.Domain

Syntax

Domain: String;

Description

The Domain property determines a name of the domain.

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.

Sub UserProc;
Var
    MbManager: IMetabaseManager;
    MbDef: IMetabaseDefinition;
    Package: ISecurityPackage;
    DC: IDomainCredentials;
    Mb: IMetabase;
    Table: ITable;
    Field: ITableField;
Begin
    MbManager := MetabaseManagerFactory.Active;
    MbDef := MbManager.Definitions.FindById("Warehouse");
    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 := "DOMAIN";
    DC.UserName := EditBox1.Text;
    DC.Password := EditBox2.Text;
    Mb := MbDef.Open(dc, ApplicationMode.Win, LocaleCodeID.Russian);
    Debug.WriteLine("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 specified repository is established, and the message about it is displayed. Names of table fields are displayed in a console window.

See also:

IDomainCredentials