procedure TFrame5.Button1Click(Sender: TObject);
var
LI: TListItem;
q :string;
begin
if Combobox1.Text =('') then
Showmessage('Bitte geben Sie einen Suchbegriff ein')
else [color=red]begin[/color]
Combobox1.AddItem(Combobox1.Text,nil);
Combobox1.Items.SaveToFile(ExtractFilePath(ParamStr(0))+'Protocoll.pnmd');
q:= '%' + Combobox1.Text + '%';
with ZReadOnlyQuery1 do
begin
close;
SQL.Clear;
SQL.Add('SELECT * FROM Addy WHERE');
SQL.Add('Name LIKE :Name OR ');
SQL.Add('Vorname LIKE :Vorname OR ');
SQL.Add('Straße LIKE :Straße OR ');
SQL.Add('PLZ LIKE :PLZ OR ');
SQL.Add('Stadt LIKE :Stadt OR ');
SQL.Add('e-Mail LIKE :e-Mail OR ');
SQL.Add('Tel LIKE :Tel OR ');
SQL.Add('Notiz LIKE :Notiz');
ParamByName ('Name').AsString := q;
ParamByName ('Vorname').AsString := q;
ParamByName ('Straße').AsString := q;
ParamByName ('PLZ').AsString := q;
ParamByName ('Stadt').AsString := q;
ParamByName ('e-Mail').AsString := q;
ParamByName ('Tel').AsString := q;
ParamByName ('Notiz').AsString := 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('Name').AsString);
LI.SubItems.Add(FieldByName('Vorname').AsString);
LI.SubItems.Add(FieldByName('Straße').AsString);
LI.SubItems.Add(FieldByName('PLZ').AsString);
LI.SubItems.Add(FieldByName('Stadt').AsString);
LI.SubItems.Add(FieldByName('e-Mail').AsString);
LI.SubItems.Add(FieldByName('Tel').AsString);
LI.SubItems.Add(FieldByName('Notiz').AsString);
Next;
end;
ListView1.Items.EndUpdate;
close;
end;
[color=red]end;[/color]
end;