Advantage TDataSet Descendant
Retrieves the type of a field in a table.
TAdsFieldTypes = ( AdsfldLOGICAL, AdsfldNUMERIC, AdsfldDATE, AdsfldSTRING,
AdsfldCISTRING, AdsfldMEMO, AdsfldVARCHAR,
AdsfldCOMPACTDATE, AdsfldDOUBLE, AdsfldINTEGER,
AdsfldSHORTINT, AdsfldTIME, AdsfldTIMESTAMP,
AdsfldAUTOINC, AdsfldRAW, AdsfldCURDOUBLE, AdsfldMONEY );
function AdsGetFieldType( strFieldName : String ) : TAdsFieldTypes;
|
strFieldName |
Name of the Field. |
The return is the type of the field. If the field type returned is mdtMEMO, the field may actually be type mdtBINARY or mdtIMAGE. The exact type can be determined by calling AdsGetMemoDataType.
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 );