IAdoMdCatalog.OpenWithCredentials

Fore Syntax

OpenWithCredentials(Credentials: ICredentials): IAdoMdCatalogInstance;

Fore.NET Syntax

OpenWithCredentials(Credentials: Prognoz.Platform.Interop.Metabase.ICredentials): Prognoz.Platform.Interop.AdoMd.IAdoMdCatalogInstance;

Parameters

Credentials. Credentials, used to open the catalog.

Description

The OpenWithCredentials method opens the ADOMD catalog with specified credentials.

Fore Example

Executing the example requires that the repository contains an ADOMD catalog with the SAP_test identifier.

Sub UserProc;
Var
    MB: IMetabase;
    SecPackage: ISecurityPackage;
    Creds: IPasswordCredentials;
    Catalog: IAdoMdCatalog;
    CatalogInst: IAdoMdCatalogInstance;
Begin
    MB := MetabaseClass.Active;
    Catalog := MB.ItemById("SAP_test").Bind As IAdoMdCatalog;
    SecPackage := New StandardSecurityPackage.Create;
    Creds := SecPackage.CreateCredentials(AuthenticationMode.Password) As IPasswordCredentials;
    Creds.UserName := "User";
    Creds.Password := "Password";
    CatalogInst := Catalog.OpenWithCredentials(Creds);
End Sub UserProc;

After executing the example the system opens the ADOMD catalog with specified credentials.

Fore.NET Example

Executing the example requires that the repository contains an ADOMD catalog with the SAP_test identifier. This example is an entry point of the .NET assembly.

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

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    SecPackage: StandardSecurityPackageClass = New StandardSecurityPackageClass();
    Creds: IPasswordCredentials;
    Catalog: IAdoMdCatalog;
    CatalogInst: IAdoMdCatalogInstance;
Begin
    MB := Params.Metabase;
    Catalog := MB.ItemById["SAP_test"].Bind() As IAdoMdCatalog;
    Creds := SecPackage.CreateCredentials(AuthenticationMode.amPassword) As IPasswordCredentials;
    Creds.UserName := "User";
    Creds.Password := "Password";
    CatalogInst := Catalog.OpenWithCredentials(Creds);
End Sub;

After executing the example the system opens the ADOMD catalog with specified credentials.

See also:

IAdoMdCatalog