KOMPONEN:
1.form17
2.ADOConnection1
3.ADOQuery1
4.DataSource1
procedure TForm2.btnSimpanClick(Sender: TObject);
begin
if messagedlg(' Yakin Merubah Data?',mtinformation,[mbyes,mbno],0)=mryes then
begin
//mengedit data
DataModule16.ADOQuery1.SQL.Clear;
DataModule16.ADOQuery1.SQL.Add('update tblpbf set nama="'+edtNama.Text+'", alamat="'+mmAlamat.Text+'", telepon="'+edtTelepon.Text+'", email="'+edtEmail.Text+'"');
DataModule16.ADOQuery1.SQL.Add('where kode="'+edtKode.Text+'"');
DataModule16.ADOQuery1.ExecSQL;
//untuk merifresh data dengan adoquery
DataModule16. ADOQuery1.SQL.Clear;
DataModule16.ADOQuery1.SQL.Add('select* from tblpbf ');
DataModule16. ADOQuery1.Open;
end;
end;
end.
0 Comments