Thema: Delphi ABSQuery und FieldType

Einzelnen Beitrag anzeigen

Benutzerbild von NoGAD
NoGAD

Registriert seit: 31. Jan 2006
Ort: Weimar
327 Beiträge
 
Delphi 10.4 Sydney
 
#11

AW: ABSQuery und FieldType

  Alt 27. Mär 2020, 08:47
Ich habe zwischenzeitlich eine Antwort vom Programmierer der ABSDatabase erhalten.

Zitat:
Please note that ABSQuery works in 2 modes:

1) ABSQuery.RequestLive = True before its opnening, and you do SELECT
from 1 table only
Then you get live result - editable records of original source table, then
datatypes should be remain the same as in source table

2) ABSQuery.RequestLive = False, or you do select from several tables,
or use UNION / GROUP BY / ... other complex options.
Then you get new temporary table - records are copied from original
tables and they are marked as read-only in this result temp table,
then autoinc datatype is changed to Integer type


Somit klappt es auf folgendem Weg:

Code:
        ABSQuery1.RequestLive := true;
        ABSQuery1.SQL.Text := 'SELECT * From ' + _Table_Name + ' WHERE 1 = 0';
        ABSQuery1.Open;
//      ABSQuery1.Fields[ x ].DataType enthält nun den aktuellen Datentyp des Feldes x in Form eines TFieldType
Das Thema kann bitte geschlossen werden.
Mathias

Geändert von NoGAD (27. Mär 2020 um 11:36 Uhr)
  Mit Zitat antworten Zitat