double klik button1 kemudian copykan script berikut:
procedure TForm1.Button1Click(Sender: TObject);
begin
if comboBox1.Text= 'kode' then
begin
query1.SQL.text:='SELECT*from tabel_buku where kode LIKE"%'+edit1.Text+'%"';
query1.Open;
end
else if comboBox1.Text= 'judul' then
begin
query1.SQL.text:='SELECT*from tabel_buku where judul LIKE"%'+edit1.Text+'%"';
query1.Open;
end
else if comboBox1.Text= 'pengarang' then
begin
query1.SQL.text:='SELECT*from tabel_buku where pengarang LIKE"%'+edit1.Text+'%"';
query1.Open;
end
else if comboBox1.Text= 'penerbit' then
begin
query1.SQL.text:='SELECT*from tabel_buku where penerbit LIKE"%'+edit1.Text+'%"';
query1.Open;
end
end;
end.
0 komentar:
Posting Komentar