Jumat, 20 Januari 2012

Form Login

Tampilan Form Login dan List Code-nya :

Source Code :
Public conn As New ADODB.Connection
Public RS As New ADODB.Recordset
Private Sub commandok_Click()
If conn.State = 1 Then conn.Close
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\login.mdb"

If RS.State = 1 Then RS.Close
RS.Open "select * from login where user= '" & Username.Text & "' And pass = '" & Password.Text & "'", conn, 3, 3
If Not RS.EOF Then
MsgBox "SELAMAT DATANG...!!!" & vbCrLf & _
"Sistem Informasi Penjualan Mobil PT.ManaTauLaku" & vbCrLf & _
"" & vbCrLf & _
"(C)opy Right by Jenson Sinaga Januari 2012", vbInformation + vbOKOnly, "Login Success"
Unload Me
FrmMenu.Show
Else
MsgBox "Data Usernama atau Password Anda Salah", vbCritical, "Login Failed"
Username.Text = ""
Password.Text = ""
Username.SetFocus
End If
End Sub
Private Sub Form_Load()
Username.Text = ""
Password.Text = ""
End Sub
Private Sub password_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Password.Text = "" Then Exit Sub
CommandOK.SetFocus
End If
End Sub
Private Sub username_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Username.Text = "" Then Exit Sub
Password.SetFocus
End If
End Sub

Tidak ada komentar:

Posting Komentar