procedure TForm1.Button2Click(Sender: TObject);
var
LI: TListItem;
q :
string;
begin
q:= Combobox1.Text;
with ZReadOnlyQuery1
do
begin
close;
SQL.Clear;
SQL.Text := ('
SELECT * FROM Tabelle WHERE '+q);
open;
ListView1.Items.BeginUpdate;
Listview1.Items.Clear;
while not (EOF)
do
begin
LI := Listview1.Items.Add;
LI.ImageIndex := 0;
LI.Caption := (FieldByName('
ID').AsString);
LI.SubItems.Add(FieldByName('
Spalte1').AsString);
LI.SubItems.Add(FieldByName('
Spalte2').AsString);
LI.SubItems.Add(FieldByName('
Spalte3').AsString);
LI.SubItems.Add(FieldByName('
Spalte4').AsString);
LI.SubItems.Add(FieldByName('
Spalte5').AsString);
LI.SubItems.Add(FieldByName('
Spalte6').AsString);
LI.SubItems.Add(FieldByName('
Spalte7').AsString);
LI.SubItems.Add(FieldByName('
Spalte8').AsString);
Next;
end;
ListView1.Items.EndUpdate;
close;
end;
end;