IMetabaseLink.UseMetabaseCredentials

Syntax

UseMetabaseCredentials: Boolean;

UseMetabaseCredentials: boolean;

Description

The UseMetabaseCredentials property determines whether the credentials specified when entering to the current repository, will be used for connecting to the database.

Comments

If the value is True, the credentials specified when entering will be used for connecting to the database; if the value is False, the credentials specified in IMetabaseLink.Credentials will be used.

Comments

By default this property is set to False. The property is relevant for use, if the IMetabaseLink.LoginPrompt property is set to False.

Example

Executing the example requires the %METABASE_SERVER% server and the TestShema schema.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Link: IMetabaseLink;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_METABASELINK;
    CrInfo.Id := "Link_1";
    CrInfo.Name := "Test1 repository connection";
    CrInfo.Parent := MB.Root;
    Link := MB.CreateObject(CrInfo).Edit As IMetabaseLink;
    Link.Authentication := AuthenticationMode.Password;
    Link.DriverId := "ORCL8";
    Link.SecurityPackage := "STANDARDSECURITYPACKAGE";
    Link.LogonData.ParamValue("SERVER") := "%METABASE_SERVER%";
    Link.LogonData.ParamValue("SCHEME") := "TestShema";
    Debug.WriteLine(Link.LoginPrompt);
    Link.LoginPrompt := False;
    Link.UseMetabaseCredentials := True;
    (Link As IMetabaseObject).Save;
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Link: IMetabaseLink;
    MBClass: MetabaseClass = New MetabaseClassClass();
Begin
    MB := Params.Metabase;
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_METABASELINK As integer;
    CrInfo.Id := "Link_2";
    CrInfo.Name := "Test1 repository connection";
    CrInfo.Parent := MB.Root;
    Link := MB.CreateObject(CrInfo).Edit() As IMetabaseLink;
    Link.Authentication := AuthenticationMode.amPassword;
    Link.DriverId := "ORCL8";
    Link.SecurityPackage := "STANDARDSECURITYPACKAGE";
    Link.LogonData.ParamValue["SERVER"] := "%METABASE_SERVER%";
    Link.LogonData.ParamValue["SCHEME"] := "TestShema";
    System.Diagnostics.Debug.WriteLine(Link.LoginPrompt);
    Link.LoginPrompt := False;
    Link.UseMetabaseCredentials := True;
    (Link As IMetabaseObject).Save();
End Sub;

After executing the example the new object Connection with Repository is created in the repository root. This object establishes connection with the repository that is placed in the TestShema scheme on the same server with the current repository. On using this method, the automatic connection to the scheme with the credentials that were specified when entering to the current repository, is established.

See also:

IMetabaseLink