LOGIN
Dim konlogin As New ADODB.Connection
Dim reclist As New ADODB.Recordset
Private Sub bukalogin()
If konlogin.State
= adStateOpen Then konlogin.Close
konlogin.ConnectionString = "provider=microsoft.jet.oledb.4.0; data
source = " & App.Path & "\login.mdb"
konlogin.CursorLocation = adUseClient
konlogin.Open
End Sub
Private Sub bukalist()
If reclist.State =
adStateOpen Then reclist.Close
reclist.Open
"select * from list", konlogin, adOpenDynamic, adLockOptimistic
End Sub
Private Sub Command1_Click()
Dim i As Integer
reclist.MoveFirst
For i = 1 To
reclist.RecordCount
If Text1.Text
= reclist!user And Text2.Text = reclist!password Then
menu.Show
MsgBox
"Selamat anda berhasil....", vbInformation, "SUKSES...!"
Unload Me
Exit Sub
Else
If i =
reclist.RecordCount Then
MsgBox
"Maaf pasword anda salah.......", vbCritical, " ^_^ coba lagi
^_^"
Text1.Text
= ""
Text2.Text
= ""
Text1.SetFocus
Else
reclist.MoveNext
End If
End If
Next i
End Sub
Private Sub Command2_Click()
If
MsgBox("Bener mau keluar?", vbYesNo + vbQuestion + _
vbDefaultButton2,
"Konfirmasi") = vbYes Then
'MsgBox
"Terima atas kunjungannya", , "Keluar"
Unload Me
End If
End Sub
Private Sub Form_Load()
bukalogin
bukalist
End Sub