Description

Assigns an Attribute Value that must be related to one of those in the McDBNode.Attributes of McDBNode instances returned by this McDBQuery.

Return Type

None  

Syntax

object.SetAttribute AtbName, AtbVal, [ValueCompOp], [DateScope], [CompCount], [CountCompOp]

The SetAttribute Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBQuery.
AtbNameRequired. A String value.

The string name of the attribute to place in the specification.

AtbValRequired. A Variant value.

The value to compare the named attribute against, as a VARIANT. The value Empty is a special “wildcard” case, meaning match any value; and it is the only value allowed for AtbVal that will process a

ValueCompOpOptional. A mcDBCompOp enumeration, as described in settings.

How one or more Attributes on the result McDBNode instances with AtbName will compare to AtbVal.

DateScopeOptional. A mcDBDateQueryType enumeration, as described in settings.

How much of the date value specified by AtbVal should be used in the query specification. Since all DATE values specify both a date and time, this parameter allows queries based on just a date or time specification. This parameter is ignored unless the attribute named by AtbName has an McDBAttributeType.Type of mcdbDate.

CompCountOptional. A Long value.

A numeric [long] value specifying the number of attributes (used with the CountCompOp argument) to filter the result McDBNodes by. This parameter is used for specification of queries on mcdbArray-type attributes only.

CountCompOpOptional. A mcDBCompOp enumeration, as described in settings.

How to compare the CompCount argument. For example: if this value is mcdbGTE, CompCount is 4, AtbVal is 7, and ValueCompOp is mcdbEQ; then the McDBNodes result set will contain McDBNode instances that have 4 or more [array element] attributes with a value of 7.

Settings

The settings for ValueCompOp are:

ConstantValueDescription
 mcdbEQ1

Equality (default)

 mcdbLT2

Less than

 mcdbGT4

Greater than

 mcdbGTE5

Greater than or Equal

 mcdbLTE3

Less than or Equal

 mcdbNEQ6

Not Equal

 mcdbIgnoreWildCards16

Wildcards in strings (* and ?) are interpreted as literals

 mcdbIgnoreCase32

Case of characters in strings is ignored

 mcdbIgnoreDiacritics64

Diacritics on characters in strings is ignored

 mcdbIgnoreWhiteSpace128

White space in strings is ignored

 mcdbIgnoreSymbols512

Symbols in strings are ignored

 mcdbMatchSubstring1024

The query string matches if it is a substring of the target property/attribute

 mcdbNoAttribute2048

The Named Attribute does not exist, only valid when using Empty wildcard

The settings for DateScope are:

ConstantValueDescription
 mcdbDateOnly1

Use Date specification of argument for Query only

 mcdbTimeOnly2

Use Time specification of argument for Query only

 mcdbDateAndTime3

Use entire argument (Date and Time) for Query

The settings for CountCompOp are:

ConstantValueDescription
 mcdbEQ1

Equality (default)

 mcdbLT2

Less than

 mcdbGT4

Greater than

 mcdbGTE5

Greater than or Equal

 mcdbLTE3

Less than or Equal

 mcdbNEQ6

Not Equal

 mcdbIgnoreWildCards16

Wildcards in strings (* and ?) are interpreted as literals

 mcdbIgnoreCase32

Case of characters in strings is ignored

 mcdbIgnoreDiacritics64

Diacritics on characters in strings is ignored

 mcdbIgnoreWhiteSpace128

White space in strings is ignored

 mcdbIgnoreSymbols512

Symbols in strings are ignored

 mcdbMatchSubstring1024

The query string matches if it is a substring of the target property/attribute

 mcdbNoAttribute2048

The Named Attribute does not exist, only valid when using Empty wildcard

Remarks

Passing an McDBQuery for AtbVal is the method for recursively querying mcdbNodeAtb attributes.

Exceptions

Error Value Description
E_INVALIDARG &H80070057 An unprocessable value was specified in AtbVal.
E_PENDING &H8000000A The database context has not been established. Call AttachDatabase().
E_FAIL &H80004005 ValueCompOp is mcdbNoAttribute and this McDBQuery has an active SortOrder (from calling AddSortOrder) of mcdbAttributeValue.

Notes

This method may be used to sort the values of a named attribute by passing the AtbName and Empty for AtbVal.