Autor Beitrag
tim4vfb
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mi 22.10.03 10:50 
Hallo,

habe mal eine Frage zu DBGRID. Wie kann ich denn die Daten die von der Datenbank in die DBGRID geladen werden sortieren? Ist es auch möglich die Daten mit einem Klick auf die jeweilige Spalte danach zu sortieren?
Maggi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP, WIN 2003
D5 Enter D 2006
BeitragVerfasst: Mi 22.10.03 10:56 
Hi,

wenn du mit SQL arbeites kannst du mit ORDER BY arbeiten, bei DBTabellen kannst du dir dafür besser Indexe anlegen die dir die gewünschten Felder Sortieren!!

Gruß

maggi
tim4vfb Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mi 22.10.03 11:06 
also ich arbeite mit SQL, hab ne ADO Connection und ne Data Source.
Wie mache ich das mit sort??
Maggi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 160

WIN XP, WIN 2003
D5 Enter D 2006
BeitragVerfasst: Mi 22.10.03 11:13 
Hi,

wie wäre es mit:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
with DB1 do 
begin 
  Close; 
  SQL.Clear; 
  SQL.Add('SELECT FELD01, FELD02, FELD03    
  FROM "c:\DATENBANK.dbf"'); 
  SQL.Add('ORDER BY FELD02, FELD03'); 
  Open; 
end;


Hoffe das hilft dir als Beispiel!

MFG

Maggi