Database: IDatabase;
The Database property determines a database that will be used in the business application.
The value of this property is set once on creating a new business application.
Executing the example requires that the repository contains a database with the DB identifier and a folder with the F_DBA identifier.
Add links to the DBA, Db and Metabase system assemblies. Add a link to the assembly that is required to work with the business application.
Sub UserProc;
Var
Mb: IMetabase;
CreateInfo: IMetabaseObjectCreateInfo;
MDesc: IMetabaseObjectDescriptor;
App: IBusinessApplication;
Helper: IMetabaseHelper;
Begin
MB := MetabaseClass.Active;
Helper := GetMetabaseHelper;
CreateInfo := MB.CreateCreateInfo;
CreateInfo.ClassId := Helper.GetCustomClassByEnum(BPClasses.Business_Application).ClassId;
CreateInfo.Id := "DBA_APP";
CreateInfo.Name := "Business application";
CreateInfo.Parent := Mb.ItemById("F_DBA");
MDesc := MB.CreateObject(CreateInfo);
MDesc := MDesc.Edit;
App := New BusinessApplication.Create(MDesc);
App.Database := MB.ItemById("DB").Bind As IDatabase;
App.SaveObject;
End Sub UserProc;
On executing the example, a new business application is created in the specified folder.
See also: