Credentials: ICredentials;
The Credentials property returns user credentials used at automatic connection to a 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.LoginPrompt := False;
DB.Credentials.SlotValue("USERNAME") := "User1";
DB.Credentials.SlotValue("PASSWORD") := "password";
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.Automatic connection to database with the specified login and the password is executed on logging in to the repository.
See also: