ADODB Object
 
Syntax
 
Fields.Append [Name][, Type][, DefineSize][, Attrib][, FieldValue]
 
Description
The Append method is used to add (append) a Field object to the Fields Collection.
Using this method, you can both append and assign a value to the object at the same time. This is useful, because the Value property must first be set and an Update must have occured, before you can set any other properties. There are three data types for the Field object that cannot be appended to the Fields Collection. If you try to use adArray, adChapter, or adEmpty, an error will occur.
 
This method has five optional parameters.
 
Parameter
Description
Name
The optional Name is the unique name of the new Field object being appended to the collection.
Type
The optional Type is one of the DataTypeEnum constants that defines the data type of the new Field.
DefinedSize
The optional DefinedSize parameter is a long value that is the size in bytes or characters of the new Field. When DefinedSize exceeds 255 bytes, the field is treated as having variable length columns.
Attrib
The optional Attrib parameter is one of the FieldAttributeEnum constants that specify the attributes of the new Field.
FieldValue
The optional FieldValue parameter is a variant that is the value for the new Field. If this parameter is not provided, it will be set to null when the new Field is appended.
 
 
DataTypeEnum Constants 
 
Constant
Value
Description
adArray
0x2000
Combine with another data type to indicate that the other data type is an array
adBigInt
20
8-byte signed integer
adBinary
128
Binary
adBoolean
11
True or false Boolean
adBSTR
8
Null-terminated character string
adChapter
136
4-byte chapter value for a child recordset
adChar
129
String
adCurrency
6
Currency format
adDate
7
Number of day since 12/30/1899
adDBDate
133
YYYYMMDD date format
adDBFileTime
137
Database file time
adDBTime
134
HHMMSS time format
adDBTimeStamp
135
YYYYMMDDHHMMSS date/time format
adDecimal
14
Number with fixed precision and scale
adDouble
5
Double precision floating-point
adEmpty
0
no value
adError
10
32-bit error code
adFileTime
64
Number of 100-nanosecond intervals since 1/1/1601
adGUID
72
Globally unique identifier
adIDispatch
9
Currently not supported by ADO
adInteger
3
4-byte signed integer
adIUnknown
13
Currently not supported by ADO
adLongVarBinary
205
Long binary value
adLongVarChar
201
Long string value
adLongVarWChar
203
Long Null-terminates string value
adNumeric
131
Number with fixed precision and scale
adPropVariant
138
PROPVARIANT automation
adSingle
4
Single-precision floating-point value
adSmallInt
2
2-byte signed integer
adTinyInt
16
1-byte signed integer
adUnsignedBigInt
21
8-byte unsigned integer
adUnsignedInt
19
4-byte unsigned integer
adUnsignedSmallInt
18
2-byte unsigned integer
adUnsignedTinyInt
17
1-byte unsigned integer
adUserDefined
132
User-defined variable
adVarBinary
204
Binary value
adVarChar
200
String
adVariant
12
Automation variant
adVarNumeric
139
Variable width exact numeric with signed scale
adVarWChar
202
Null-terminated Unicode character string
adWChar
130
Null-terminated Unicode character string
 
 
FieldAttributeEnum Constants 
 
Constant
Value
Description
adFldCacheDeferred
0x1000
Provider caches values and reads from cache
adFldFixed
0x10
Fixed-length data
adFldIsChapter
0x2000
Chapter value with specified child recordset
adFldIsCollection
0x40000
Collection of resources
adFldIsDefaultStream
0x20000
Contains default stream
adFldIsNullable
0x20
Accepts null values
adFldIsRowURL
0x10000
Contains URL to resource in data source
adFldKeyColumn
0x8000
Primary key or part of primary key
adFldLong
0x80
Long binary field and can use AppendChunk and GetChunk methods
adFldMayBeNull
0x40
Can read null values
adFldMayDefer
0x2
Values are not retrieved with whole record
adFldNegativeScale
0x4000
Can support negative scale values
adFldRowID
0x100
Contains a row identifier used only to ID the row
adFldRowVersion
0x200
Uses time/date to track updates
adFldUnknownUpdatable
0x8
Provider cannot determine if you can write to field
adFldUnspecified
-1
Does not specify attributes
adFldUpdatable
0x4
Can write to field
See Also
 
Example
 
objRecord.Fields.Append "Age", adInteger