Description

Create a new McDBAttributeType instance in this collection.

Return Type

A McDBAttributeType object.  

Syntax

object.Add (Name, Type, [DefaultValue], [Owner], [EnumStrings], [EnumValues])

The Add Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBAttributeTypes.
NameRequired. A String value.

The name of the McDBAttributeType to add/create in this collection. The value of this parameter must not contain period (.) characters, and must be unique within this collection. That is, there must not already be an element with this Name in the owning McDBType.Attributes collection.

TypeRequired. A mcDBAtbType enumeration, as described in settings.
DefaultValueOptional. A Variant value.

The default value McDBAttributes of the McDBAttributeType created from this call will have, until an explicit value is assigned. Using this parameter is simply a shortcut to assigning the McDBAttributeType.DefaultValue property after this call.

OwnerOptional. A String value.

The name of the module handling the attribute type. If this parameter is not specified, the name of this module ("McDBLib") will be used, which is appropriate in most cases anyway.

EnumStringsOptional. A Variant value.

A Variant containing an array of strings that will be used as the list of discrete string choices for the new McDBAttributeType. This parameter is only used if Type is mcdbEnum, and must be specified with EnumValues.

EnumValuesOptional. A Variant value.

A Variant containing an array of [long] numbers that will be used as the list of numeric values corresponding to the string choices in EnumStrings. This parameter is only used if Type is mcdbEnum, and must be specified with EnumStrings.

Settings

The settings for Type 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

Exceptions

Error Value Description
E_INVALIDARG &H80070057 The DefaultValue parameter is incompatible with the Type parameter, or a different number of elements exist in the EnumStrings and EnumValues parameters, or the Name or Type is not valid.
E_UNEXPECTED &H8001FFFF A framework error occurred while creating the McDBAttributeType.
E_ACCESSDENIED &H80070005 The McDBDatabase.LoggedUser does not have McDBAttributeType or McDBType Administration privileges (McDBRightsOwner.AttributeTypeAdminRight and McDBRightsOwner.ObjectTypeAdminRight, respectively).