Description

Set the value of an attribute on the Selection or the Current.

Return Type

A Long value.  

Syntax

object.SetAttribute (sAttributeDisplayName, sAttributeKeyName, eATBType, sFormat, vValue, bJustCurrentNoSelection, [eFlagsToOr])

The SetAttribute Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDataNodes.
sAttributeDisplayNameRequired. A String value. Display name of the attribute
sAttributeKeyNameRequired. A String value. KeyName (McAttributeType.Name) name of the attribute.
eATBTypeRequired. A mcDBAtbType enumeration, as described in settings. Storage type of the attribute.
sFormatRequired. A String value. Optional DisplayFormat for the attribute (vbNullString).
vValueRequired. A Variant value. Required value for attribute that must be compatible with eAtbType.
bJustCurrentNoSelectionRequired. A Boolean value. When True the current will be affected rather than the Selection
eFlagsToOrOptional. A mcDataAttributeFlags enumeration, as described in settings. Flags values to Add to the the McAttributeType to hide or protect the attribute from the user interface.

Settings

The settings for eATBType are:

ConstantValueDescription
 mcdbEmpty1

No value: not valid for defining an McDBAttributeType

 mcdbOther2

A value handled by a module other than McDBLib

 mcdbLong3

A single, integral Long value

 mcdbBlob4

An array of Byte values

 mcdbDate5

A single Date value

 mcdbString6

A single String value

 mcdbDouble7

A single, real numeric (Double) value

 mcdbObject8

An OLE object

 mcdbEnum9

A discrete, pre-defined String Choice value

 mcdbNodeAtb10

A McDBNode, having its own McDBType, but no location in the McDBNode hierarchy

 mcdbArrayDouble11

An array of real, numeric (Double) values

 mcdbArrayLong12

An array of integral Long values

 mcdbArrayString13

An array of String values

The settings for eFlagsToOr are:

ConstantValueDescription
 mcdataf_AttributeNodeOnly32768

A McDBNode of this type should only be created as an attribute and not as a Child so that McDBNode::IsContainer is false (McDBType). This value may be used to filter out Attribute hierarchy McDBType instances.

 mcdataf_NoExtract851968

Do not attempt to extract content for this Object (McDBAttributeType,McDBType)

 mcdataf_RestoreNew131072

Attempt load of non-existing content from database to an object (McDBAttributeType,McDBType).

 mcdataf_NoArchive262144

Do not attempt to save content from an object to a database (McDBAttributeType,McDBType).

 mcdataf_NoRestoreExisting524288

Do not attempt overwrite on existing content from database to an object(McDBAttributeType)

 mcdataf_FolderNode524288

A McDBNode with a Folder McDBType must have Folder McDBType Parents (McDBType).

 mcdataf_System1048576

System Attribute disallows user-interface manipulation of object (McDBNode, McDBType, McDBAttributeType).


System Attribute may disallow user-interface manipulation

 mcdataf_Hidden2097152

Hidden Attribute disallows viewing in the user-interface (McDBNode, McDBType, McAttributeType).


Hidden Attribute may disallow viewing in the user-interface

 mcdataf_Readonly4194304

ReadOnly Attribute may disallow user-interface modification (McDBNode, McDBType, McDBAttributeType).


ReadOnly Attribute may disallow user-interface modification

 mcdataf_LocalValue8388608

LocalValue disallows copying to other databases (McDBType,McDBAttributeType).


LocalValue may disallow attribute copying to other databases

 mcdataf_AutoList16777216

AutoList Attributes may populates list of known values (McDBAttributeType).


AutoList Attributes may populates list of known values

 mcdataf_Creatable16777216

A McDBNode of this type may be created by a UI (McDBType).

 mcdataf_AddToMcDBType16777216

This flag is not persisted in the database but is used by the SetAttribute method to specify that a new McDBAttributeType should be added to McDBNode.Type/

 mcdataf_HideATBType33554432

Disallows viewing in the user-interface except when value exists (McDBAttributeType).

 mcdataf_Downloadable33554432

A McDBNode of this type may be downloaded from the web UI (McDBType).

 mcdataf_All_NodeType67076096

All of the bits that apply to a McDBType

 mcdataf_All_Node15728640

All of the bits that apply to a McDBNode

 mcdataf_All_Attribute67043328

All of the bits that apply to a McDBAttributeType

 mcdataf_All67076096

All of the bits that apply to mcDataAttributeFlags in all objects (McDBNode, McDBType, McDBAttributeType).

Remarks

The McDBAttributeType will be created on each McDBNode instance's McDBType when it does not exist.
A failure will occur when an attribute already exist in the McDBType with .Name = sAttributeKeyName
and a different mcDBAtbType.