//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
//获取Table1 字段值、长度及类型 FlyFeng凤兮归来
AnsiString sType[39]={ "ftUnknown", "ftString",
"ftSmallint", "ftInteger", "ftWord", "ftBoolean",
"ftFloat", "ftCurrency", "ftBCD","ftDate","ftTime",
"ftDateTime","ftBytes","ftVarBytes","ftAutoInc",
"ftBlob","ftMemo","ftGraphic","ftFmtMemo",
"ftParadoxOle","ftDBaseOle","ftTypedBinary",
"ftCursor","ftFixedChar","ftWideString","ftLargeint",
"ftADT","ftArray","ftReference","ftDataSet",
"ftOraBlob","ftOraClob","ftVariant","ftInterface",
"ftIDispatch","ftGuid","ftTimeStamp","ftFMTBcd"};
Table1->Active=true;
AnsiString Info("The fields are: ");
for(int i = 0; i < Table1->FieldCount; i++)
Info = Info+
Table1->Fields->Fields[i]->FieldName +
"(长度:"+
Table1->Fields->Fields[i]->DataSize +
" 类型: "+sType[Table1->Fields->Fields[i]->DataType] +
")"+ ", ";
ShowMessage(Info);
Table1->Active=false;
}
//---------------------------------------------------------------------------