IMetaDictionary.Database

Syntax

Database: IDatabase;

Description

The Database property determines database that stores attribute values.

Example

Executing the example requires an MDM repository with the RDS_REPO identifier and a database with the DB identifier.

Add links to the Metabase, Rds, Dal, Db system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    ObjMb: IMetabaseObject;
    RDS: IMetabaseObjectDescriptor;
    Dict: IMetaDictionary;
    CrInfo: IMetabaseObjectCreateInfo;
    Des: IMetabaseObjectDescriptor;
    Attributes: IMetaAttributes;
    Att: IMetaAttribute;
    AttrNamings: IMetaAttributeNamings;
    AttNm: IMetaAttributeNaming;
Begin
    Mb := MetabaseClass.Active;
    CrInfo := Mb.CreateCreateInfo;
    CrInfo.Id := 
"DICT1";
    CrInfo.Name := 
"Dict";
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_METADICTIONARY;
    RDS := Mb.ItemById(
"RDS_REPO");
    CrInfo.Parent := RDS;
    Des := Mb.CreateObject(CrInfo);
    ObjMb := Des.Edit;
    Dict := ObjMb.GetExtensionDispatch 
As IMetaDictionary;
    Dict.Database := Mb.ItemById(
"DB").Bind As IDatabase;
    Attributes := Dict.Attributes;
    Attributes.CreateTable;
    AttrNamings := Dict.AttributeNamings;
    Att := Attributes.Add;
    Att.DataType := DbDataType.Integer;
    Att.Id := 
"KEY";
    Att.Name := 
"Key";
    Att.Nullable := 
False;
    AttNm := AttrNamings.Add(Att);
    ObjMb.Save;
End Sub UserProc;

After executing the example an object (the DICT1 identifier), used to store system information, is created in the MDM repository with one mandatory attribute KEY. A table to store attributes values is also created.

See also:

IMetaDictionary