UseMetabaseCredentials: Boolean;
The UseMetabaseCredentials property determines whether the credentials specified when entering to the current repository, will be used for connecting to the database.
The property is relevant if the IMetabaseLink.LoginPrompt property is set to False.
Available values:
True. The credentials specified on connection to the current repository are used.
False. Default value. The credentials specified in the IMetabaseLink.Credentials property are used.
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;
After executing the example the new object Connection with Repository is created in the repository root. This object establishes connection with the repository located in the TestShema schema on the same server with the current repository. When using this method, the automatic connection to the schema with the credentials that were specified when entering to the current repository, is established.
See also: