MaMu
07-02-2009, 20:36:05
Quiero detectar el tipo de campo de una tabla de mySQL, pero esta funcion que hice no me funciona:
function GetTipoCampoSQL(oQry : TZQuery; Index: Integer) : String;
var TipoField: TFieldDef;
begin
TipoField := oQry.FieldDefs.Items[Index];
case TipoField.DataType of
ftUnknown: result := 'ftUnknown';
ftString: result := 'ftString';
ftSmallint: result := 'ftSmallint';
ftInteger: result := 'ftInteger';
ftWord: result := 'ftWord';
ftBoolean: result := 'ftBoolean';
ftFloat: result := 'ftFloat';
ftCurrency: result := 'ftCurrency';
ftBCD: result := 'ftBCD';
ftDate: result := 'ftDate';
ftTime: result := 'ftTime';
ftDateTime: result := 'ftDateTime';
ftBytes: result := 'ftBytes';
ftVarBytes: result := 'ftVarBytes';
ftBlob: result := 'ftBlob';
ftMemo: result := 'ftMemo';
ftGraphic: result := 'ftGraphic';
end;
end;
Cuales son los FieldDef de mySQL ???
function GetTipoCampoSQL(oQry : TZQuery; Index: Integer) : String;
var TipoField: TFieldDef;
begin
TipoField := oQry.FieldDefs.Items[Index];
case TipoField.DataType of
ftUnknown: result := 'ftUnknown';
ftString: result := 'ftString';
ftSmallint: result := 'ftSmallint';
ftInteger: result := 'ftInteger';
ftWord: result := 'ftWord';
ftBoolean: result := 'ftBoolean';
ftFloat: result := 'ftFloat';
ftCurrency: result := 'ftCurrency';
ftBCD: result := 'ftBCD';
ftDate: result := 'ftDate';
ftTime: result := 'ftTime';
ftDateTime: result := 'ftDateTime';
ftBytes: result := 'ftBytes';
ftVarBytes: result := 'ftVarBytes';
ftBlob: result := 'ftBlob';
ftMemo: result := 'ftMemo';
ftGraphic: result := 'ftGraphic';
end;
end;
Cuales son los FieldDef de mySQL ???