Button tambah 
begin 
tambah:=true; 
with adoquery1 do 
begin 
sql.clear; 
active:=false; 
sql.text:='select NO_REK from NASABAH where NO_REK='+quotedstr(edit1.Text); 
active:=true; 
if (edit1.Text=fields[0].asstring) then 
tambah:=false; 
end; 
if (tambah=true) then 
begin 
with adoquery1 do 
begin 
active:=false; 
sql.text:='insert into 
NASABAH(NO_REK,PIN,BUKU_TAB,ATM)values('+quotedstr(edit1.text)+','+quotedstr(edit3.text)+','+ 
quotedstr(edit4.text)+','+quotedstr(edit5.text)+')'; 
execsql; 
end; 
end; 
with adoquery1 do 
begin 
sql.clear; 
active:=false; 
sql.text:='select * from NASABAH'; 
active:=true; 
end; 
messagedlg('Data berhasil disimpan',mtinformation,[mbok],0);
hapus 
if messagedlg('Anda yakin akan menghapus?',mtinformation,[mbyes,mbno],0)=mryes then 
adoquery1.Delete; 
messagedlg('Data sudah dihapus',mtinformation,[mbok],0) 
end; 
update 
adotable1.Edit; 
adotable1['No_REK']:=edit1.Text; 
adotable1['PIN']:=edit3.Text;; 
adotable1['BUKU_TAB']:=edit4.Text; 
ADOTABLE1['ATM']:=EDIT5.Text; 
ADOTABLE1.Post; 
end; 
keluar 
CLOSE 
Cari 
if adoquery1.Locate(combobox1.text,edit2.Text,[lopartialkey])=TRUE then 
showmessage('data ditemukan!') 
else 
showmessage('coba lagi!!!!'); 
end; 
cetak 1 
rvproject1.Execute; 
cetak 2 
quickrep1.preview; 
clear 
edit1.clear 
edit2.clear 
edit3.clear
Button tambah

Button tambah

  • 1.
    Button tambah begin tambah:=true; with adoquery1 do begin sql.clear; active:=false; sql.text:='select NO_REK from NASABAH where NO_REK='+quotedstr(edit1.Text); active:=true; if (edit1.Text=fields[0].asstring) then tambah:=false; end; if (tambah=true) then begin with adoquery1 do begin active:=false; sql.text:='insert into NASABAH(NO_REK,PIN,BUKU_TAB,ATM)values('+quotedstr(edit1.text)+','+quotedstr(edit3.text)+','+ quotedstr(edit4.text)+','+quotedstr(edit5.text)+')'; execsql; end; end; with adoquery1 do begin sql.clear; active:=false; sql.text:='select * from NASABAH'; active:=true; end; messagedlg('Data berhasil disimpan',mtinformation,[mbok],0);
  • 2.
    hapus if messagedlg('Andayakin akan menghapus?',mtinformation,[mbyes,mbno],0)=mryes then adoquery1.Delete; messagedlg('Data sudah dihapus',mtinformation,[mbok],0) end; update adotable1.Edit; adotable1['No_REK']:=edit1.Text; adotable1['PIN']:=edit3.Text;; adotable1['BUKU_TAB']:=edit4.Text; ADOTABLE1['ATM']:=EDIT5.Text; ADOTABLE1.Post; end; keluar CLOSE Cari if adoquery1.Locate(combobox1.text,edit2.Text,[lopartialkey])=TRUE then showmessage('data ditemukan!') else showmessage('coba lagi!!!!'); end; cetak 1 rvproject1.Execute; cetak 2 quickrep1.preview; clear edit1.clear edit2.clear edit3.clear