Size Property

See Also    Example    Applies To

Sets or returns a value that indicates the maximum size, in bytes, of a CdbField object.

Syntax

VOIDSetSize(LONG lSize );

LONGGetSize(VOID);

Parameters

Type Argument Description
LONG lSize A Long that specifies the length of the field.

Remarks

For an object not yet appended to the Fields collection, this property is read/write.

For fields (other than Memo type fields) that contain character data, the Size property indicates the maximum number of characters that the field can hold. For numeric fields, the Size property indicates how many bytes of storage are required.

Use of the Size property depends on the object that contains the Fields collection to which the CdbField object is appended, as shown in the following table.

Object appended to Usage
CdbIndex Not supported
CdbQueryDef Read-only
CdbRecordset Read-only
CdbRelation Not supported
CdbTableDef Read-only

When you create a CdbField object with a data type other than Text, the Type property setting automatically determines the Size property setting; you don't need to set it. For a CdbField object with the Text data type, however, you can set Size to any integer up to the maximum text size (255 for Microsoft Jet databases). If you do not set the size, the field will be as large as the database allows.

For Long Binary and Memo CdbField objects, Size is always set to 0. Use the FieldSize method of the CdbField object to determine the size of the data in a specific record. The maximum size of a Long Binary or Memo field is limited only by your system resources or the maximum size that the database allows.