Authentication: AuthenticationMode;
The Authentication property determines type of authentication, used at connection to database.
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. Password authentication is used at connection to database. The login and password are taken from the registration data, specified on logging in to the Platform.
See also: