Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 29.11.03 11:39 
Wie kann ich unter Delphi 3.0 eine DBTabelle zum Sortieren nach bestimmten Kriterien aufrufen, um nicht jedesmal das Programm beenden zu müssen und BDE zu starten?? :?
infomio
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win xy

BeitragVerfasst: So 30.11.03 11:48 
nimm eine query-komponente und ändere die order by indem du

a, das komplette sql-statement neu aufbaust
oder
b, die zeile order by feld1, feld2 asc
ersetzt: query1.sql.strings[4] := 'order by feld2, feld1';
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 02.12.03 14:34 
Titel: Kommandozeilenparameter für BDE
Liebes infomio,

vielen Dank erstmal für die Antwort, mittlerweile habe ich ein bisschen an dem Code basteln können, aber noch nicht den Durchbruch erzielen können.

Was war in deiner Antwort mit [4] gemeint?

:? Den Code von mir sende ich sonst auch noch nach

viele Grüße, D. Annies
infomio
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win xy

BeitragVerfasst: Di 02.12.03 20:24 
Titel: Re: Kommandozeilenparameter für BDE
D. Annies hat folgendes geschrieben:
Liebes infomio,

Was war in deiner Antwort mit [4] gemeint?



Nehmen wir an dein SQL-Statement sieht ungefähr so aus:

select * from Tabelle

where ID >= 100

order by ID

dann ist die Zeile mit order by, die fürs Sortieren zuständig ist, die 4. Zeile, da bei einer Query die erste Zeile 0 ist.
Folglich kannst du diese Zeile wie oben erläutert ersetzen. Z.Bsp.:

Query1.Close;
Query1.sql.strings[4] := 'order by ID, Datum';
Query1.Open;

_________________
Viele Wege führen nach Rom - aber welcher führt zurück???
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 03.12.03 20:36 
Titel: kdozeilenparameter
Danke, infomio, jetzt weiß ich bescheid!

Viele Grüße, D. Annies