DefinedSize Property

The DefinedSize property on a Field object indicates the defined size of a field object. This property returns a Long value that reflects the defined size of a field as a number of bytes.

size = field.DefinedSize
 

Remarks

The DefinedSize property is used to return the data capacity or length of a Field object. For all fields, the DefinedSize property is read-only. If ADO cannot determine the length of the Field object, the ActualSize property returns adUnknown.

The ActualSize and DefinedSize properties on a field object can be different. For example, a Field object with a declared type of adVarChar (variable character data type) and a maximum length of 50 characters returns a DefinedSize property value of 50, but the ActualSize property value it returns is the length of the data stored in the field for the current record.