Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi zeos endlose schleife (https://www.delphipraxis.net/48514-zeos-endlose-schleife.html)

xaverras 26. Jun 2005 17:22

Datenbank: mysql • Version: 4.10x • Zugriff über: zeos

zeos endlose schleife
 
Hallo,

warum gerät diese Procedure in eine endlose Schleife, wenn ich die sql Query alleine ausführe bekomme ja was ich haben möchte zwar 4 Records.

Danke

Xaver
Delphi-Quellcode:
procedure TVetriebsmitarbiterAbrechnung.SelectVpPartner;
var
von, bis, sEmonat,sEJahr: String;
sVoNr,sStorno,sAirTime, szip, sname, sforename, saddress, stotal, scity: String;
iStornoPercent, iAirTimePercent: Integer;
begin
sEmonat:=ComboBoxMonat.Text;
sEJahr:= EditJahr.Text;
von:= DBLookupComboBoxVoNrVon.Text;
bis:= DBLookupComboBoxVoNrBis.Text;
DMVPAP.ZEmployees.Close;
DMVPAP.ZEmployees.SQL.Text:= 'SELECT COUNT(*) AS total, employees.airtime_percet, employees.storno_percent,';
DMVPAP.ZEmployees.SQL.Add('employees.air_time, employees.employee_storno, employees.vo_nr, employees.name,');
DMVPAP.ZEmployees.SQL.Add('employees.forename, employees.address, employees.zip, employees.city');
DMVPAP.ZEmployees.SQL.Add('FROM employees, orders');
DMVPAP.ZEmployees.SQL.Add('WHERE');
DMVPAP.ZEmployees.SQL.Add('MONTH(activation_date)="'+sEmonat+'"');
DMVPAP.ZEmployees.SQL.Add('AND YEAR(activation_date)="'+sEJahr+'"');
DMVPAP.ZEmployees.SQL.Add('AND employees.vo_nr');
DMVPAP.ZEmployees.SQL.Add('BETWEEN "'+ von +'"');
DMVPAP.ZEmployees.SQL.Add('AND "'+bis+'"');
DMVPAP.ZEmployees.SQL.Add('AND orders.state = "aktiv"');
DMVPAP.ZEmployees.SQL.Add('AND orders.vo_nr = employees.vo_nr');
DMVPAP.ZEmployees.SQL.Add('GROUP BY orders.vo_nr');
DMVPAP.ZEmployees.Open;



while NOT DMVPAP.ZEmployees.Eof do
begin
stotal:=         DMVPAP.ZEmployees['total'];
iAirTimePercent:= DMVPAP.ZEmployees['airtime_percet'];
iStornoPercent:= DMVPAP.ZEmployees['storno_percent'];
sAirTime:=       DMVPAP.ZEmployees['air_time'];
sStorno:=        DMVPAP.ZEmployees['employee_storno'];
sVoNr:=          DMVPAP.ZEmployees['vo_nr'];
sname:=          DMVPAP.ZEmployees['name'];
sforename:=      DMVPAP.ZEmployees['forename'];
saddress:=       DMVPAP.ZEmployees['address'];
szip:=           DMVPAP.ZEmployees['zip'];
scity:=          DMVPAP.ZEmployees['city'];

MemoAbrechung.Lines.Add('query:'+ stotal+','+szip+','+sVoNr+'+');

end;


end;
[edit=Sharky]Ich habe die Delphi-Tags gesetzt. Es wäre aber auch gut wenn Du den Code mal formatieren würdest. Mfg, Sharky[/edit]

xaverras 26. Jun 2005 19:07

Re: zeos endlose schleife
 
Hallo,

ich habe gelöst, es hat eine 'DMVPAP.ZEmployees.Next;' am ende der Schleife gefehlt.

Danke.

Xaver

Kompon Ente 26. Jun 2005 19:08

Hi,

ich kann Dir sagen warum: weil die viel zu lange ist!!! :lol:

Nee, Du, sorry, kein Plan! ^^


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:38 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz