Sintak Pencarian

procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text=” then
begin
MessageDlg(‘Masukan kata kunci’,mtWarning,[mbok],0);
form2.close

end
else
begin
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add(‘select * from t_pelanggan’);
sql.Add(‘where pelanggan like’ + QuotedStr(edit1.Text + ‘%’)) ;
Prepared;
Open;
end;
if ADOQuery1.RecordCount = 0 then
begin
MessageDlg(‘Maaf data tidak ditemukan!’,mtInformation,[mbok],0);
edit1.Clear

end   else
form2.show;
end;
end;
end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: