Autor Beitrag
bbfan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164



BeitragVerfasst: Di 16.05.06 10:39 
Hallo Leute!

Wie kann ich den Spalten Type aus einer Tabelle über ADO auslesen?
Ich müsste zum Beispiel erkennen ob es CHAR(50) oder ein INTEGER ist.

Oder macht man das üebr SQL? Wenn ja, Wie?

Viele Grüße,
BBFAN
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 16.05.06 11:57 
Vor einer Abfrage oder als Tpen des Antwortcursors. im ersten fall: Abfrage über die Metadaten der Tabelle.
Im zweiten fall kannst du den FieldType den typ abfragen oder über die Klasse des TFields.

_________________
Markus Kinzler.
bbfan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164



BeitragVerfasst: Di 16.05.06 12:30 
Danke für die Antwort, aber könntest du bitte einwenig mehr ins Detail gehen?
Vielen Dank.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 16.05.06 12:37 
1.) Ein DBMS verwaltet im Normalfall die Tabellen und Felder der Tabellen auch in sogenannten SYSTEM-Tabellen. Über diese kann man über normale SQL-Abfragen die Felder und deren Typen einer Tabelle ermitteln.
2.) if fld is TFloatField then ...

_________________
Markus Kinzler.