Einzelnen Beitrag anzeigen

Dragon27

Registriert seit: 20. Nov 2003
Ort: Aßling
543 Beiträge
 
Delphi XE6 Enterprise
 
#1

Fehler beim suchen und auflisten in einer Datenbank

  Alt 12. Feb 2004, 14:12
hi folgendes Problem:

Bei diesem Code bleibt immer das Programm stecken:

Delphi-Quellcode:
procedure TForm1.Button8Click(Sender: TObject);
begin

if combobox1.Text=''
 then checkbox1.Checked:=false;
 if combobox2.Text=''
 then checkbox2.Checked:=false;
  if combobox3.Text=''
 then checkbox3.Checked:=false;

if (checkbox1.Checked=true)and(checkbox2.Checked=true)and(checkbox3.Checked=true)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('Kategorie').AsString=combobox1.Text) and (clientdataset1.FieldByName('MainProgramm').AsString=combobox2.Text) and (clientdataset1.FieldByName('Typ').AsString=combobox3.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox1.Checked=true)and(checkbox2.Checked=true)and(checkbox3.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('Kategorie').AsString=combobox1.Text) and (clientdataset1.FieldByName('MainProgramm').AsString=combobox2.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox1.Checked=true)and(checkbox2.Checked=false)and(checkbox3.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('Kategorie').AsString=combobox1.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox2.Checked=true)and(checkbox3.Checked=true)and(checkbox1.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('MainProgramm').AsString=combobox2.Text) and (clientdataset1.FieldByName('Typ').AsString=combobox3.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox1.Checked=true)and(checkbox3.Checked=true)and(checkbox2.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('Kategorie').AsString=combobox1.Text) and (clientdataset1.FieldByName('Typ').AsString=combobox3.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox2.Checked=true)and(checkbox3.Checked=false)and(checkbox1.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('MainProgramm').AsString=combobox2.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

if (checkbox3.Checked=true)and(checkbox2.Checked=false)and(checkbox1.Checked=false)
then begin
    clientdataset1.First;
while not clientdataset1.Eof do begin
if (clientdataset1.FieldByName('Typ').AsString=combobox3.Text)
then begin
  Listbox6.Items.Add(clientdataset1.FieldByName('Name').AsString);
  clientdataset1.Next;
  end;
end;
end;

end;
Bitte helft mir ich finde den Fehler nicht

Danke!
Delphi is ......... DELPHI!!
  Mit Zitat antworten Zitat