IDatabase.UseMetabaseCredentials

Syntax

UseMetabaseCredentials: Boolean;

Description

The UseMetabaseCredentials property determines whether the credentials, specified on logging in to the platform, are used for connection to database.

Comments

If the property is set to True, the credentials, specified when logging in to the platform, are used, and also automatic connection to database at logging into the system is established.

Example

Sub Main;

Var

MB: IMetabase;

CrInfo: IMetabaseObjectCreateInfo;

MObj: IMetabaseObject;

DB: IDatabase;

Begin

MB := MetabaseClass.Active;

CrInfo := MB.CreateCreateInfo;

CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DATABASE;

CrInfo.Id := "NewBD";

CrInfo. Name: = "New database";

CrInfo.Parent := MB.Root;

MObj := MB.CreateObject(CrInfo).Edit;

DB := MObj As IDatabase;

DB.Authentication := AuthenticationMode.Password;

DB.DriverId := "ORCL";

DB.LogonData.ParamValue("SERVER") := "Test";

DB.LogonData.ParamValue("SCHEME") := "TestShema";

DB.UseMetabaseCredentials := True;

MObj.Save;

End Sub Main;

After executing the example, a new database is created in repository root. Data is settled on the Test server in the TestShema scheme. On connecting to a database the credentials, specified on logging in to the Platform, are used.

See also:

IDatabase