Add

Description

Adds a new QueryFieldDef object to this QueryFieldDefs collection.

Passing in a field path argument to this method, fills in the field path for the new object. If you do not specifiy a field path, then you must use the FieldPathName method of the QueryFieldDef Object to set the value.

For VBScript, you use the Add method to add a new QueryFieldDef to the collection. If the Variant argument:

  • Contains a BSTR, then the content of the BSTR is treated as the field path.
  • Does not contain a BSTR, it should have type VT_EMTPY.

For Perl, there are two separate methods that accomplish the same functionality:

  • AddByFieldPath
  • AddNew
Note: This method provides an alternate method to the BuildField method of the QueryDef Object.

These methods add a new QueryFieldDef object to the end of the collection. You can retrieve items from the collection using the Item method.

Syntax

VBScript


queryfielddefs.Add path 

Perl


$queryfielddefs->AddByFieldPath(fieldPath);
$queryfielddefs->AddNew(); 
Identifier
Description
queryfielddefs
A QueryFieldDefs collection object, representing the set of QueryFieldDef objects available for fetching as a collection.
path
(VBScript only) A Variant containing either a field path as a BSTR, or VT_EMPTY which adds a new QueryFieldDef object to this collection.
fieldPath
(Perl only) A String containing the field path to the QueryFieldDef object to add to this collection.
Return value
Returns the QueryFieldDef object that was added.