Rabu, 02 Juli 2014

Login Dengan Modul Sederhana

 
Tampilan Utama :


Component : 
Label1             Caption           Login Here
Label2             Caption           Username
Label3             Caption           Password
Text1               Caption           ( Kosong )
                        Name              txt_user
Text2               Caption          ( Kosong )
                        Name               txt_pass
Command1      Caption            Login
                        Name               cmd_log
Command2      Caption            Cancel
                        Name               cmd_can


Coding !!
Private Sub cmd_log_Click()
If Len(Trim(txt_user.Text)) = 0 Then
MsgBox "Isikan User", vbExclamation, "P E R I N G A T A N"
txt_user.SetFocus
Exit Sub
End If
If Len(Trim(txt_pass.Text)) = 0 Then
MsgBox "Isikan Password"
txt_user.SetFocus
Exit Sub
End If
Set rs = New ADODB.Recordset
users = txt_user.Text
With txt_pass
.SetFocus
.SelLength = 0
.SelStart = Len(Trim(.Text))
MenuUtama.Show
End With

End Sub
Private Sub cmd_can_Click()
End
End Sub

Untuk menambahkan modul,
caranya : klik kanan pada login > pilih add modul .
Tuliskan ini di modul :

Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim i As Integer

Tampilan Akhir :