Hi
Ich mache eine
SQL Abfrage mit folgendem Code:
SQL-Code:
procedure TForm1.bSucheClick(Sender: TObject);
var
ListItem : TlistItem;
begin
dbMain.Host:=edServer.Text; //Server
dbMain.Login:=edLogin.Text; //Benutzername
dbMain.Password:=edPassword.Text; //Passwort
dbMain.Database:=edDB.Text; //Name der Datenbank
dbMain.Connected:=True; //Verbindung herstellen
lvAnzeige.Items.Clear;
try
qrMain.SQL.Text :=
'SELECT ' +
'T.Order_Type,' +
'T.Customer_Number,' +
'T.Order_Number,' +
'T.First_Event,' +
'T.PrePrint,' +
'T.Print,' +
'T.BMSLogout,' +
'K.Na,' +
'K.Customer_Number,' +
'K.Str,'+
'K.Ort,' +
'K.Tel,' +
'K.Ap ' +
'FROM ' +
'table_ordertracking T,' +
'kundenmg K ' +
'WHERE ' +
'T.Customer_Number=K.Customer_Number ' +
'AND ' +
'T.Customer_Number like ''' + edknr.Text + '''"%" ' +
'AND ' +
'T.Order_Number like ''' + edatnr.Text + '''"%" ' +
'ORDER BY ' +
'T.Order_Number;';
qrMain.Open;
qrMain.FieldByName('Order_Type').AsString;
gauge1.Visible:= True;
gauge1.maxvalue := qrMain.recordcount;
while not qrMain.Eof do
begin
ListItem := lvAnzeige.Items.Add;
ListItem.Caption:=qrMain.FieldByName('Order_Type').AsString;
ListItem.SubItems.Add(qrMain.FieldByName('Customer_Number').AsString);
ListItem.SubItems.Add(qrMain.FieldByName('Order_Number').AsString);
ListItem.SubItems.Add(qrMain.FieldByName('First_Event').AsString);
ListItem.SubItems.Add(qrMain.FieldByName('PrePrint').AsString);
ListItem.SubItems.Add(qrMain.FieldByName('Print').AsString);
ListItem.SubItems.Add(qrMain.FieldByName('BMSLogout').AsString);
lName.Caption:=qrMain.FieldByName('Na').AsString;
lStr.Caption:=qrMain.FieldByName('Str').AsString;
lOrt.Caption:=qrMain.FieldByName('Ort').AsString;
lTel.Caption:=qrMain.FieldByName('Tel').AsString;
lAP.Caption:=qrMain.FieldByName('AP').AsString;
gauge1.progress := gauge1.progress + 1;
qrMain.Next;
end;
gauge1.progress := 0;
gauge1.Visible:= false;
finally
dbMain.Connected:=False; //Verbindung trennen
end;
end;
Wie kann ich jetzt mit einem Label oder Edit die Anzahl der gefundenen Datensätze anzeigen?
Benutze Delphi 7 Prof und die Zeos Kompos Versin 5.5
Gruß Celina