DefinedSize

This property is used to determine the data capacity of a Field object. It returns the defined size of the field in characters. It is comparable to ActualSize, which returns the size in bytes.

Syntax

var = field.DefinedSize

Return Values

Returns a number that specifies the maximum length of the field.

Remarks

ADOCE supports two string types: strings with less than 256 characters and memo strings of up to 32,733 Unicode characters. These lengths are set when the table is created and are enforced when setting data. For strings with less than 256 characters, DefinedSize returns the length specified when the table was created. For text fields that have undefined length, DefinedSize returns the maximum number of characters the field can hold — 32,733 Unicode characters.

The DefinedSize and ActualSize properties are different. For example, a Field object with a declared type of 202 (adVarWChar) and a maximum length of 50 characters returns a DefinedSize property value of 50, but the ActualSize property value it returns is the number of bytes of data stored in the field for the current record. This may be longer than the defined size because adVarWChar characters require two bytes per character.