IAdoMdCatalog.UseMetabaseCredentials

Fore Syntax

UseMetabaseCredentials: Boolean;

Fore.NET Syntax

UseMetabaseCredentials: boolean;

Description

The UseMetabaseCredentials property determines whether credentials, specified when logging to the system, are used to connect to the database.

Comments

If this property is set to True, user credentials, specified at logging to repository are used, and also the automatic connection to the database is set at system login.

Fore Example

Sub Macro;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    CatAdo: IAdoMdCatalog;
    Creds: IPasswordCredentials;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_ADOMD_CATALOG;
    CrInfo.Id := "MAS_TEST";
    CrInfo.Name := "Catalog based on MSSQL Analysis Services";
    CrInfo.Parent := MB.Root;
    CatAdo := MB.CreateObject(CrInfo).Edit As IAdoMdCatalog;
    CatAdo.Driver := "MSOLAP";
    CatAdo.Server := "MAS_TEST";
    CatAdo.Name := "TEST_CUBE";
    CatAdo.Authentication := AuthenticationMode.Password;
    CatAdo.UseMetabaseCredentials := False;
    Creds := Catalog.Credentials As IPasswordCredentials;
    Creds.UserName := "User1";
    Creds.Password := "password";
    CatAdo.Credentials := Creds;
    (CatAdo As IMetabaseObject).Save;
End Sub Macro;

After executing the example a new ADOMD catalog is created in the repository root directory. Automatic connection to the TEST_CUBE database, located on the MAS_TEST server, is set up for this catalog. The Microsoft MSSQL Analysis Services driver and given user credentials are used at connection.

Fore.NET Example

Imports Prognoz.Platform.Interop.AdoMd;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    CatAdo: IAdoMdCatalog;
    Creds: IPasswordCredentials;
Begin
    MB := Params.Metabase;
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_ADOMD_CATALOG As Integer;
    CrInfo.Id := "MAS_TEST";
    CrInfo.Name := "Catalog based on MSSQL Analysis Services";
    CrInfo.Parent := MB.Root;
    CatAdo := MB.CreateObject(CrInfo).Edit() As IAdoMdCatalog;
    CatAdo.Driver := "MSOLAP";
    CatAdo.Server := "MAS_TEST";
    CatAdo.Name := "TEST_CUBE";
    CatAdo.Authentication := AuthenticationMode.amPassword;
    CatAdo.UseMetabaseCredentials := False;
    Creds := Catalog.Credentials As IPasswordCredentials;
    Creds.UserName := "User1";
    Creds.Password := "password";
    CatAdo.Credentials := Creds;
    (CatAdo As IMetabaseObject).Save();
End Sub;

After executing the example a new ADOMD catalog is created in the repository root directory. Automatic connection to the TEST_CUBE database, located on the MAS_TEST server, is set up for this catalog. The Microsoft MSSQL Analysis Services driver and given user credentials are used at connection.

See also:

IAdoMdCatalog