Name

Fields.Append Method — (Versions 2.0, 2.1, 2.5, 2.6)

Synopsis

                     fields.Append Name, Type, DefinedSize, Attrib, FieldValue
                  

The Append method adds a new Field object to the collection.

Arguments

Name (String)

Represents the name of the field to append to the Fields collection. This name must not already exist within the collection.

Type (DataTypeEnum)

Specifies the datatype of the Field’s Value property. The default value for this parameter is adEmpty.

DefinedSize (String)

Optional. Dictates the length of the value stored within the Field object. The value of this parameter is derived from the Type property.

Attrib (FieldAttributeEnum)

Optional. Specifies additional information regarding the new Field object. The default value for this parameter is adFldDefault.

FieldValue (Variant)

Optional. Gives the new Field object a value. The default for this parameter is Null. This parameter is valid only when adding a Field object to a Record object’s Fields collection, not a Recordset object’s.

Description

The following datatypes are not supported by ADO and cannot be used when adding new Field objects to the collection class: adIDispatch, adIUnknown, and adVariant.

The following datatypes cannot be added to the Field’s collection and will generate an error: adArray, adChapter, adEmpty, adPropVariant, and adUserDefined.

When using the Append method with a Fields collection of a Recordset object, you cannot use the FieldValue parameter. Instead, you must add the Field objects while the Recordset ...

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.