Listing Program - 64 Listing Program Login Option Explicit...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 64 Listing Program Login Option Explicit Dim a As Integer Public rs_cekpengguna As ADODB.Recordset Private Sub Form_Load() Move (Screen.Width - Width) / 2, _(Screen.Height - Height) / 3 Call Bukadatabase End Sub Private Sub cmdok_Click() On Error GoTo Pesan: If txtuser.Text = "'OR''='" Then txtuser.Text = "" txtpass.Text = ""txtuser.SetFocus ElseIf txtuser.Text = "" Then MsgBox "Username masih kosong !", _ vbInformation + vbOKOnly, "Information" txtuser.SetFocus ElseIf txtpass.Text = "" Then MsgBox "Password masih kosong !", _ vbInformation + vbOKOnly, "Information" txtpass.SetFocus Else sql = "SELECT * FROM pengguna WHERE" _ & " nm_pengguna='" & txtuser.Text & "' " _ & " AND status='" & cmbstat.Text & "'" Set rs_cekpengguna = DbKoneksi.Execute(sql) If Not rs_cekpengguna.EOF Then sql = "SELECT * FROM pengguna WHERE status='" & cmbstat.Text & "'" _ 65 & " AND password ='" & txtpass.Text & "' " Set rs_cekpengguna = DbKoneksi.Execute(sql) If Not rs_cekpengguna.EOF Then Konfirmasi = MsgBox("Koneksi berhasil " _ & " masuk dalam sistem!", _ vbOKCancel + vbInformation, "Information") If cmbstat.Text = "Admin" Then menu.Show Unload Me ElseIf cmbstat.Text = "User" Then menu.Show menu.mntran.Enabled = False menu.mnlap.Enabled = False menu.mnfile.Enabled = False Unload Me End If Else If a < 2 Then MsgBox "Password masih salah," _ & " Silahkan ulangi lagi!", _ vbInformation + vbOKOnly, "Information" txtpass.Text = "" txtpass.SetFocus a = a + 1 Else MsgBox "Anda Bukan User Yang Berhak!", _ vbCritical + vbOKOnly, "Information" 66 End End If End If Else MsgBox "Anda belum terdaftar!", _ vbCritical + vbOKOnly, "Konfirmasi" txtuser.Text = "" txtpass.Text = "" txtuser.SetFocus End If End If Exit Sub Pesan: MsgBox "Penulisan salah !!! " & _ Chr(13) & "Silakan ulangi lagi!", _ vbInformation + vbOKOnly, "Informasi" txtuser.Text = ""txtpass.Text = "" txtuser.SetFocus End Sub Private Sub TxtUser_Change() txtpass.Text = "" End Sub Private Sub TxtUser_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then txtpass.SetFocus KeyAscii = 0 End If End Sub 67 Private Sub TxtPass_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then cmdok.SetFocus KeyAscii = 0 End If End Sub Private Sub cmdcancel_Click() End End Sub Menu Private Sub MDIForm_Load() Move (Screen.Width - Width) / 2, _ (Screen.Height - Height) / 3 End Sub Private Sub mninstansi_Click() Instansi.Show End Sub Private Sub mnjenislab_Click() jenis_lab.Show End Sub Private Sub mnkajian_Click() Kajian.Show End Sub Private Sub mnkwitan_Click() buktibayar.Show End Sub Private Sub mnlab_Click() 68 Laboratorium.Show End Sub Private Sub mnkunjung_Click() pengunjung.Show End Sub Private Sub mnlabpreview_Click() viewlab.Show End Sub Private Sub mnlapkjl_Click() lapKJL.Show End Sub Private Sub mnlapkwitansi_Click() lapbuktibayar.Show End Sub Private Sub mnlaplhul_Click() lapSSKJL.Show End Sub Private Sub mnpengunjung_Click() viewpng.Show End Sub Private Sub mnperusahaan_Click() Perusahaan.Show End Sub Private Sub mnuser_Click() pengguna.Show End Sub Private Sub x_Click() 69...
View Full Document

Page1 / 104

Listing Program - 64 Listing Program Login Option Explicit...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online