Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Funktion die den Feldtyp als String zurückgibt (https://www.delphipraxis.net/8741-funktion-die-den-feldtyp-als-string-zurueckgibt.html)

Nalincah 11. Sep 2003 08:58


Funktion die den Feldtyp als String zurückgibt
 
Liste der Anhänge anzeigen (Anzahl: 1)
Mit dieser einfachen, doch praktischen Funktion kann man den Feldtyp einer Datenbank als String zurückgeben.

Einfach mit ReturnTypFkt(ADOTable1.FieldByName('Feld1').FieldT ype) aufrufen

Delphi-Quellcode:
unit ReturnTyp;

interface

uses db;

function ReturnTypFkt(T : TFieldType):string;

implementation

function ReturnTypFkt(T : TFieldType):string;
begin
  case T of
    ftString      : Result := 'VarChar';
    ftFloat       : Result := 'Float';
    ftCurrency    : Result := 'Währungsfeld';
    ftMemo        : Result := 'Memo';
    ftBlob        : Result := 'Long';
    ftDate        : Result := 'Date';
    ftDateTime    : Result := 'Date/Time';
    ftTime   : Result := 'Time';
    ftSmallInt    : Result := 'SmallInt';
    ftInteger     : Result := 'Integer';
    ftBoolean     : Result := 'Boolean';
    ftBytes   : Result := 'Bytes';
    ftWord        : Result := 'Word';
    ftTimeStamp    : Result := 'TimeStamp';
    ftVariant     : Result := 'Variant';
    ftBCD         : Result := 'BCD';
    ftVarBytes    : Result := 'VarBytes';
    ftAutoInc     : Result := 'AutoInc';
    ftGraphic     : Result := 'Graphic';
    ftFmtMemo     : Result := 'FmtMemo';
    ftParadoxOle   : Result := 'ParadoxOle';
    ftDBaseOle   : Result := 'DBaseOle';
    ftTypedBinary : Result := 'TypedBinary';
    ftCursor   : Result := 'Cursor';
    ftFixedChar   : Result := 'FixedChar';
    ftWideString : Result := 'WideString';
    ftLargeint   : Result := 'Largeint';
    ftADT        : Result := 'ADT';
    ftArray      : Result := 'Array';
    ftReference  : Result := 'Reference';
    ftDataSet    : Result := 'DataSet';
    ftOraBlob    : Result := 'OraBlob';
    ftOraClob    : Result := 'OraClob';
    ftInterface  : Result := 'Interface';
    ftIDispatch  : Result := 'IDispatch';
    ftGuid       : Result := 'Guid';
    ftFMTBcd     : Result := 'FMTBcd';
    else Result := 'unbekannt';
  end;
end;

begin
end.
[edit=sakura]Unit-Code eingefügt. Damit jeder sieht, worum es geht. Mfg, sakura[/edit]

Leuselator 18. Sep 2003 02:09

Re: Funktion die den Feldtyp als String zurückgibt
 
Du Fleißpelz :wink:


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz