"Berikut ini adalah contoh form Login
<<Form Login>>
Private Sub cmdlogin_Click()
If txtpass = "" Then
MsgBox "Password Kosong", vbCritical, "Perhatian"
txtpass.SetFocus
Exit Sub
End If
If rspass.State = adStateOpen Then
rspass.Close
End If
rspass.Open "select * from tblpassword where pass='" & txtpass & "'", _
Koneksi, adOpenDynamic, adLockPessimistic, adCmdText
If Not rspass.EOF Then
form1.Show
Unload Me
Else
MsgBox "Password Salah..!!", vbCritical, "Warning"
txtpass = ""
txtpass.SetFocus
Exit Sub
End If
End Sub
Private Sub txtpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdlogin_Click
End IfEnd Sub
<<Modul>>
Public rspass As New ADODB.Recordset
Sub BukaDataBase()
Koneksi.CursorLocation = adUseClient
Koneksi.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& App.Path & "\dbpangkat.mdb;Jet OLEDB:Database Password="
End Sub
Sub Main()
BukaDataBase
frmlogin.Show
End Sub
semoga bermanfaat,,..Kalau mau Copas silahkan,tapi tolong kasih link sumbernya ya!!
Thanks...
"
<<Form Login>>
Private Sub cmdlogin_Click()
If txtpass = "" Then
MsgBox "Password Kosong", vbCritical, "Perhatian"
txtpass.SetFocus
Exit Sub
End If
If rspass.State = adStateOpen Then
rspass.Close
End If
rspass.Open "select * from tblpassword where pass='" & txtpass & "'", _
Koneksi, adOpenDynamic, adLockPessimistic, adCmdText
If Not rspass.EOF Then
form1.Show
Unload Me
Else
MsgBox "Password Salah..!!", vbCritical, "Warning"
txtpass = ""
txtpass.SetFocus
Exit Sub
End If
End Sub
Private Sub txtpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdlogin_Click
End IfEnd Sub
<<Modul>>
Public rspass As New ADODB.Recordset
Sub BukaDataBase()
Koneksi.CursorLocation = adUseClient
Koneksi.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& App.Path & "\dbpangkat.mdb;Jet OLEDB:Database Password="
End Sub
Sub Main()
BukaDataBase
frmlogin.Show
End Sub
semoga bermanfaat,,..Kalau mau Copas silahkan,tapi tolong kasih link sumbernya ya!!
Thanks...
"
Tidak ada komentar :
Posting Komentar