Baca Juga
Cara Membuat Login Admin
Buatlah database nya :
Nama :
login.mdb
Nama table :
tbllogin
Field
|
Type
|
Primary Key
|
User
|
Text
|
|
pass
|
Text
|
Lalu Ketikkan kode nya :
1. Kode form1
dengan nama Aplikasi Login
Letakkan
di commandButton1 dengan nama cmdsave
Private
Sub cmdsave_Click()
If
(txtuser.Text <> "") And (txtpass.Text <> "")
Then
adologin.RecordSource
= "select*from tbllogin"
adologin.Refresh
With
adologin.Recordset
.AddNew
!user
= txtuser.Text
!Pass
= txtpass.Text
.Update
MsgBox
"Berhasil", vbInformation + vbOKOnly, "pesan"
End
With
txtuser.Text
= ""
txtpass.Text
= ""
Else
MsgBox
"Data Belum Lengkap", vbInformation + vbOKOnly, "pesan"
txtpass.Text
= ""
txtpass.Text
= ""
End
If
End
Sub
2. Kode form2
dengan nama Pesan Login
Letakkan
di commandButton2 dengan nama cmdlogin
If
(txtuser.Text <> "") And (txtpass.Text <> "")
Then
adologin.RecordSource
= "select*from tbllogin"
adologin.Refresh
With
adologin.Recordset
.AddNew
!user
= txtuser.Text
!Pass
= txtpass.Text
End
With
MsgBox
"Berhasil", vbInformation + vbOKOnly, "Pesan"
Form2.Show
Else
MsgBox
"Salah Password coy", vbCritical, "Peringatan"
txtpass.Text
= ""
txtpass.Text
= ""
End
If
End
Sub
Dan inilah gambar Aplikasi Login
EmoticonEmoticon