喘口气,到这里转转.
下面这段代码可以用,
你可以用 findtype(table1.fields[0]) 做测试 ,在我这里工作的好好的。that's all.
Function TFrmMain.FindType(aField: TField): string;
begin
case aField.DataType of
ftString: Result := 'String';
ftAutoInc: Result := 'Auto-inc 32-bit integer';
//自动增长域 for My MsSql Server , it's identity fields
ftInteger: Result := '32-bit integer';
ftWord: Result := '16-bit unsigned integer';
ftSmallint: Result := '16-bit integer';
ftBoolean: Result := 'Boolean';
ftFloat: Result := 'Float';
ftCurrency: Result := 'Money';
ftGraphic: Result := 'Bitmap';
ftFmtMemo: Result := 'Formatted text memo';
ftParadoxOle: Result := 'Paradox OLE';
ftDBaseOle: Result := 'dBASE OLE';
ftTypedBinary: Result := 'Typed binary';
ftBCD: Result := 'BCD';
ftDate: Result := 'Date';
ftTime: Result := 'Time';
ftDateTime: Result := 'DateTime';
ftBytes: Result := 'Fixed bytes (binary)';
ftVarBytes: Result := 'Variable bytes (binary)';
ftBlob: Result := 'BLOB';
ftMemo: Result := 'Text memo';
else
Result := '未知';
end;
end;