UseMetabaseCredentials: Boolean;
The UseMetabaseCredentials property determines whether the credentials specified when entering to the current repository, will be used for connecting to the database.
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 Credentials will be used.
By default this property is set to False. This property is relevant, if the LoginPrompt property was set to False.
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 := "Connection with Test1 repository";
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 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: