Autor Beitrag
bruder jonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Sa 03.05.03 16:16 
hallo,

wenn ich per query "select *" abfrage, wie komme ich an die einzelnen werte ran?

z.b 1 tabellenspalte, 2 spalte, ...

danke
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 03.05.03 16:24 
Query123.FieldByName('FELDNAME').AsString; AsInteger; As123bla. (Str+Space hilft ;)
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Sa 03.05.03 18:25 
So z.B. :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
with query1 do begin
  sql.clear;
  sql.Add('SELECT * FROM tabellenname');
  open;
  active := true;
  while not eof do begin
    stringlist.add(Fields[1].AsString);
    next;
  end;
  Active := false;
end;
Alfons-G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 307

Win XP Prof, Linux, Win 7
D5 Prof, D7 Architect, D2005 Architect, D2007 Architect
BeitragVerfasst: Sa 03.05.03 19:20 
Wobei die Fields-Auflistung etwas schneller ist, als FieldByName. Nachdem man bei FieldByName den Feldnamen als String übergeben kann, ist man dabei jedoch flexibler und die Gefahr, beim Ändern der Querys einen Fehler zu machen, ist geringer.

:)

_________________
Alfons Grünewald
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: So 04.05.03 14:44 
Hallo,

vieleicht brings dich dieses Tutorial auch noch ein Stück weiter.

Gruß
Klabautermann