Arsip: Sintak Update SQL

 
user image
more 11 years ago

asepolin

tbpembelian_tmp.Active := false ; tbpembelian_tmp.CommandText := 'Select * from pembelian_tmp '; tbpembelian_tmp.Active := false; tbpembelian_tmp.First; while not tbpembelian_tmp.Eof do begin edit9.Text := tbpembelian_tmp['kode_barang']; with adoquery1 do begin if AdoQuery1.Active = true then close ; adoquery1.SQL.Clear; adoquery1.SQL.text:= 'update data_barang set stok = stok + ' + tbpembelian_tmp.fieldbyname('quantitas').Value + 'where kode_barang = ' + quotedstr(edit9.Text) ; adoquery1.Open; end; tbpembelian_tmp.Next; end; PESAN ERRONYA ADALAH : invalid variant type converstion kenapa ya .. please help me .....
user image
more 11 years ago

cyber_hecker

adoquery1.SQL.text:= 'update data_barang set stok = stok + ' + tbpembelian_tmp.fieldbyname('quantitas').Value + 'where kode_barang = ' + quotedstr(edit9.Text) ;
adoquery1.SQL.text := 
  'update data_barang set stok = stok + ' + 
  tbpembelian_tmp.fieldbyname('quantitas').AsString + 
  'where kode_barang = ' + quotedstr(edit9.Text) ;
user image
more 11 years ago

mas_kofa

@asepolin: tbpembelian_tmp.Active := false ; tbpembelian_tmp.CommandText := 'Select * from pembelian_tmp '; tbpembelian_tmp.Active := false;
apa yg ini gak salah......... yang baris ketiga

 tbpembelian_tmp.Active := true;
kale........
user image
more 11 years ago

asepolin

@cyber_hecker: adoquery1.SQL.text:= 'update data_barang set stok = stok + ' + tbpembelian_tmp.fieldbyname('quantitas').Value + 'where kode_barang = ' + quotedstr(edit9.Text) ;
adoquery1.SQL.text := 
  'update data_barang set stok = stok + ' + 
  tbpembelian_tmp.fieldbyname('quantitas').AsString + 
  'where kode_barang = ' + quotedstr(edit9.Text) ;
asvalue sudah di ganti menjadi asstring HASILNYA TETEP ERROR BOS
user image
more 11 years ago

asepolin

@mas_kofa:
@asepolin: tbpembelian_tmp.Active := false ; tbpembelian_tmp.CommandText := 'Select * from pembelian_tmp '; tbpembelian_tmp.Active := false;
apa yg ini gak salah......... yang baris ketiga

 tbpembelian_tmp.Active := true;
kale........
tbpembelian_tmp.active := true; uidah di ganti tetep BOS
user image
more 11 years ago

asepolin

sintak sudah saya rubah menjadi seperti ini with adoquery1 do begin if AdoQuery1.Active = true then close ; adoquery1.SQL.Clear; adoquery1.SQL.add('update data_barang set stok = stok + ' + tbpembelian_tmp.fieldbyname('quantitas').asstring + 'where kode_barang ='+edit9.Text ) ; adoquery1.ExecSQL; end; PESAN ERROR-NYA SBB : CHECK TH MANUAL THAT CORRESPONDS TO YOUR MYSQL server version for the righ syntax to user near 'KODE_BARANG=TS-C1-002-001-001' at line 1. process stioped
user image
more 11 years ago

asepolin

berkat pertolongan ALLAH SQT hasil akhir seperti ini : tbpembelian_tmp.Active := false ; tbpembelian_tmp.CommandText := 'Select * from pembelian_tmp '; tbpembelian_tmp.Active := true; tbpembelian_tmp.First; while not tbpembelian_tmp.Eof do begin edit9.Text := tbpembelian_tmp['kode_barang']; with adoquery1 do begin if AdoQuery1.Active = true then close ; adoquery1.SQL.Clear; adoquery1.SQL.add('update data_barang set stok = stok + :quantitas where kode_barang = ' + quotedstr(edit9.Text) ) ; adoquery1.Prepared; adoquery1.Parameters[0].Value := tbpembelian_tmp['quantitas']; adoquery1.ExecSQL; end; tbpembelian_tmp.Next; end;
user image
more 11 years ago

elva_ivana

@asepolin , jadi dah bener ya ...
user image
more 11 years ago

ichan29

adoquery1.SQL.text:= 'update data_barang set stok = stok + ' + tbpembelian_tmp.fieldbyname('quantitas').Value + 'where kode_barang = ' + quotedstr(edit9.Text) ; 
adoquery1.SQL.text := 
  'update data_barang set stok = stok + ' + 
  tbpembelian_tmp.fieldbyname('quantitas').AsString + 
  'where kode_barang = ' + quotedstr(edit9.Text) ;
@asepolin: asvalue sudah di ganti menjadi asstring HASILNYA TETEP ERROR BOS
@asepolin: sebetulnya punyamu itu jg betul secara query, yg dr rekan cyber jg betul, disini error itu karena dikau kurang teliti aja.. COBA
...tbpembelian_tmp.fieldbyname('quantitas').AsString +
' where kode_barang = ' + quotedstr(edit9.Text)
itu harus ada SPASI, error itu karena fieldbyname('quantitas').AsString nyambung dg where
user image
more 11 years ago

asepolin

makasih kepada semuanya sudah memberikan bantuan,, mohon maaf kalau saya banyak kirang telitinya... semangat terus belajarnya...
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com