Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Guesuper Guesuper is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 408
Rep Power: 15
Guesuper mempunyai hidup yang Normal
Default [ask] tombol cari data di delphi gan

gan ane mau tanya nie....ane kan ingin mencari dalam dua buah table dalam satu form....lebih jelas nya nie aku kasih formnya,,,







and ini srcipnya gan....

kok querynya gak mau ya.......



procedure TFdatapegawai.btncariClick(Sender: TObject);

begin

if ecari.Text = ''then showmessage('data kosong') else

begin

if (cbcari.Text ='NIP') then

begin

with dm.qpegawai,dm.qjabatan do

begin

close;

sql.Clear;

sql.Add('select * from pegawai,jabatan where pegawai.nip=:kd and jabatan.nip=:nip');

prepared;

parameters.Items[0].Value:=ecari.Text;

parameters.Items[1].value:=ecari.Text;

open;

end;

getrecord;

if dm.qpegawai.RecordCount = 0 then

messagedlg('Data tidak ada',mtinformation,[MBOK],0);

refresh;

end

else

if cbcari.Text ='Nama Pegawai' then

begin

with dm.qpegawai,dm.qjabatan do

begin

close;

sql.Clear;

sql.Add ('select * from pegawai,jabatan where pegawai.nip:=kd and jabatan.nip=:kd');

prepared;

parameters.Items[0].Value:=ecari.Text;

parameters.Items[1].Value:=ecari.Text;

open;

end;

end;

getrecord;

if dm.qpegawai.RecordCount = 0 then

messagedlg('Data tidak ada',mtinformation,[MBOK],0);

end;

end;



semoga agan agan programer bisa membantu.....

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
JUAL Aplikasi Pengolahan Data menggunakan Pemrograman BORLAND DELPHI (versi 6 atau 7) virusmuka Software Original & Open Source 0 26th May 2012 10:54 AM
cara mencari&amp;mengedit data melalui datagrid dengan delphi PHPmaster Programming 0 20th November 2011 11:38 PM
[ask]penampilan data kok gak bisa ya (delphi) Guesuper Programming 0 20th November 2011 09:23 AM
[ask]nulis data ke notepad dari delphi Servermaster Programming 0 20th November 2011 02:08 AM
[HELP] butuh bantuan porgramer delphi soal data mining, lokasi bandung Braincode Programming 0 11th November 2011 02:02 PM

 


All times are GMT +7. The time now is 03:44 AM.