Advantage TDataSet Descendant
Retrieves the number of a field in a table.
function AdsGetFieldNum( strFieldName : String ) : Word;
|
strFieldName |
Name of field. |
The field number is an index in the table of the fields from first to last, with the index of the first field being 1.
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 );