Thursday, April 10, 2008

Sekilas tentang program vb

perintah simpan dengan menggunakan perintah SQL

===============================================
CN.Execute "INSERT INTO BIO_PEGAWAI VALUES ('" + TNIP.Text + "','" + TNAMA.Text + "','" & Format(TTTL.Value, "mm/dd/yyyy") & "','" + TSTATUS.Text + "','" + JNS + "','" + TGOL.Text + "','" + TJUM_ANAK.Text + "')"
MsgBox ("Data Sudah Tersimpan"), vbInformation
===============================================

perintah edit dengan menggunakan perintah SQL

===============================================
BIO_PEG.Open "select * from bio_pegawai where nip='" & cari & "'", CN, adOpenKeyset, adLockOptimistic
CN.Execute "update BIO_PEGAWAI set NIP ='" + TNIP.Text + "',NAMA = '" + TNAMA.Text + "', TTL ='" & Format(TTTL.Value, "mm/dd/yyyy") & "',STATUS = '" + TSTATUS.Text + "',JENKEL = '" + JNS + "',GOLONGAN ='" + TGOL.Text + "',JML_ANAK='" + TJUM_ANAK.Text + "' where NIP = '" & cari & "'"
MsgBox ("Data Telah Teredit"), vbInformation
===============================================

perintah HAPUS dengan menggunakan perintah SQL


===============================================
Set BIO_PEG = New ADODB.Recordset
BIO_PEG.Open "select * from bio_pegawai", CN, adOpenKeyset, adLockOptimistic
CN.Execute " delete from bio_pegawai where nip = '" + TNIP.Text + "'"
MsgBox ("Data Sudah Terhapus"), vbInformation

===============================================