Advantage TDataSet Descendant
Retrieves length of a field in a table.
function AdsGetFieldLength( strFieldName : String ) : Longint;
|
strFieldName |
Name of field. |
AdsGetFieldLength returns the length of the field in bytes. For memos, binary fields, and variable-length character fields, this function will return the length of the portion stored in the record rather than the actual data length.
AdsTable1.Active := TRUE;
{ retrieve field information }
lFieldLength := AdsTable1.AdsGetFieldLength( 'LastName' );
wFieldDecimals := AdsTable1.AdsGetFieldDecimals( 'LastName' );
lFieldOffset := AdsTable1.AdsGetfieldOffset( 'LastName' );
eFieldType := AdsTable1.AdsGetFieldType( 'LastName' );
wFieldNum := AdsTable1.AdsGetFieldNum( 'LastName' );
{ get the successive field's name }
strFieldName := AdsTable1.AdsGetFieldName( wFieldNum + 1 );