SetDBFieldLength

Mon 01 January 2018

Syntax

SetDBFieldLength(Field.FieldName, Length)

Description

Use the SetDBFieldLength function to modify an existing character field to have a new length.

Note: Because using this function changes records that are used to build application tables, you must rebuild (alter) the specified project before these changes can be used.

Use the Length Field class property to find the existing length of a field.

Note: This function only works with character fields.

Parameters

Field or Control

Definition

FieldName

Specify the name of the field that you want to modify. This name must be prefixed by the reserved word Field .

Length

Specify the new field length as a number between 1 and 254.

Note: If a default has been specified for this field in any record, and the size of the default is greater than the new size, you must modify the record field separately.

Returns

A constant value. The values are:

Value

Description

%MDA_Success

Function completed successfully.

%MDA_Failure

Function didn't complete successfully.

%MDA_Unsupported

The specified field isn't a character field. This function is only supported for character fields.

%MDA_FieldNotFound

The specified field wasn't found.

%MDA_FieldFmtLength

The specified length isn't compatible with the current format family, or there are record field defaults greater than the specified size.

Note: If a default has been specified for this field in any record, and the size of the default is greater than the new size, you must modify the record field separately.