Arsip: Insert Data ke MySQL

 
user image
more 13 years ago

coacoac

para master2 delphi..aq tanya gmn agar data 'Pengisian=5000' selalu ditambah dg data yang baru (Data lama + Data Baru), jadi setiap saya klik BitBtnSimpan, datanya selalu bertambah 5000, gtu..listing programq kayak gini, mb da yg hrs dirubah, coz pada saat data sudah kesimpan pada database,dia tdk mau nambah lagi.(Error);

procedure TFormPulsa.BitBtnSimpanClick(Sender: TObject);
var
     PernyataanSQL : String;
begin
   if RadioButtonLima.Checked then
      begin
          PernyataanSQL :=
          'insert into pulsa set Pengisian = 5000, No_Kendaraan = ' + QuotedStr(EditNo_Kendaraan.Text);
          SQLConnectionPulsa.ExecuteDirect(PernyataanSQL);
      end;
end;
Normalisasinya : Tabel : Pulsa ----------------- No_Kendaraan (primary key) Pengisian
user image
more 13 years ago

budi_bunga

kayaknya klo insert ito pake into ... kalo pake set itu update ... set .....
user image
more 13 years ago

faathir

mei bi (mungkin/meureun) gini....
procedure TFormPulsa.BitBtnSimpanClick(Sender: TObject);
var
     PernyataanSQL : String;
begin
   if RadioButtonLima.Checked then
      begin
          PernyataanSQL :=
          'insert into pulsa (Pengisian, No_kendaraan) values (5000, QuotedStr(EditNo_Kendaraan.Text))';
          SQLConnectionPulsa.ExecuteDirect(PernyataanSQL);
      end;
end;
mungkin...
user image
more 13 years ago

coacoac

terima kasih ya semuanya....
more ...
  • Pages:
  • 1
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com