Field Object

A Field object should not be directly created because it exists only in the context of a recordset. Use Set to refer to a specific Field object.

The following table shows the properties the Field object supports.

Property Description
ActualSize Indicates the actual length, in bytes, of a field’s value.
Attributes Returns a value that indicates one or more characteristics of a Field object.
DefinedSize Used to determine the data capacity of a Field object; returns the defined size of the field in characters.
Name Returns the name of a field.
Type Indicates the data type of a Field object.
UnderlyingValue Indicates the current value of a Field object in the database.
Value (default) Indicates the current value of a Field object in the recordset.

Remarks

The Field object has no methods or events. With the exception of Value, all properties are read-only.

The following code example shows how to use a Field object to display data in a table.

Dim rs, f
Set rs = CreateObject("adoce.recordset")
rs.Open "MSysTables"
Set f = rs.Fields(0)
Msgbox f.Value, ,f.Name