Autor Beitrag
Crowbar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mo 10.03.03 13:22 
Hallo,
wie kann ich meine erzeugte SQL-Tabelle in einem DBGrid darstellen?
Es soll der gesamte Inhalt angezeigt werden.

Tschüss Crowbar
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Mo 10.03.03 13:33 
Hi,

folgende Kompos auf die Form : TQuery, TDataSource, TDBGrid. Dann verbindest Du TDatasource mit TQuery und TDBGrid mit TDatasource und dann schreibst Du folgenden Code in eine Button-Click :

ausblenden Quelltext
1:
2:
3:
  Query1.SQL.Clear;
  Query1.SQL.Add('SELECT * FROM tabelle;');
  Query1.Open;


Das war alles.
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mo 10.03.03 13:43 
Hi, vielen Dank, hat gut geklappt!
bye Crowbar
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Mo 10.03.03 14:22 
Zitat:
Query1.SQL.Add('SELECT * FROM tabelle;');


... tut mir leid für diese krümel-kackrige anmerkung, aber könnt ja auch sein, das es doch wichtig ist... :shock:

.... gehört das ";" hinter "tabelle"?


mfg
Crowbar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 180

WinXP, SP2
D6 Enterprise
BeitragVerfasst: Mo 10.03.03 14:25 
Zitat:
.... gehört das ";" hinter "tabelle"?


Nein, das ";" hinter "table" muss bzw. kann weg. Ich habe es weggelassen und es funktioniert bestens.

Bye Crowbar
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Mo 10.03.03 18:35 
Du kannst es machen kannst es aber auch nicht. Da ich auch viel Zeilenbasiert in MySQL mache, habe ich mir das angewöhnt, denn da musst Du ein Semikolon hinter jede Anweisung schreiben, sonst wird die nicht ausgeführt, wenn MySQL auf Linux läuft.
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Mo 10.03.03 18:38 
Hey, das ist mir neu, hört sich aber gut an, werd ich mir mal merken...

thx