Posted by : Unknown Kamis, 13 Desember 2012

Pada Kesempatan Kali ini Debuger's menyajikan langkah membuat form lagin pada Visual Basic atau yang lebih sering di sebut dengan VB, berikut langkah-langkahnya :
Desain sebuah form seperti gambar dibawah ini :


Kemudian pada halam coding editor ketik coding berikut ini :
'Call buat_koneksi
If cek.State = 1 Then cek.Close
cek.Open "select * from user_login where " & _ "user_id='" & Replace(Text1, "'", "''") & "'", koneksi, adOpenDynamic, adLockOptimistic
If Not cek.EOF Then
cek.Close
cek.Open "select * from user_login "
& _ "where user_id='" & Replace(Text1, "'", "''") & "' " & _ "and password='" & Replace(Text2, "'", "''") & "'", koneksi, adOpenDynamic, adLockOptimistic
If Not cek.EOF Then
MDIForm1.mnuData.Enabled = True
MDIForm1.mnuFile.Enabled = True
MDIForm1.mnuHelp.Enabled = True
MDIForm1.mnuReport.Enabled = True
MDIForm1.mnuView.Enabled = True
MDIForm1.mnuTrans.Enabled = True
MDIForm1.vbButton1.Enabled = True
MDIForm1.vbButton3.Enabled = True
MDIForm1.cmdMNUMekanik.Enabled = True
MDIForm1.cmdMNUSpare.Enabled = True
MDIForm1.cmdMNUSupplier.Enabled = True
MDIForm1.cmdLog.Enabled = True
MDIForm1.cmdLog.ToolTipText = "LogOut"
If cek!Level = "Admin" Then
MDIForm1.vbButton2.Enabled = True
MDIForm1.mnuIUser.Enabled = True
Else
MDIForm1.vbButton2.Enabled = False
MDIForm1.mnuIUser.Enabled = False
End If
frmLogin.Hide
MDIForm1.Show
Else
n = n + 1
MsgBox "Sorry, User or Password is Wrong !", vbExclamation, "Warning"
With Text1
.SelStart = 0
.SelLength = Len(Text1)
.SetFocus
End With
Text2 = ""
If n > 3 Then
MsgBox "Sorry, you're have a 3x
Wrong, Application will Close!", 64, "Information"
End
End If
End If
Else
n = n + 1
MsgBox "Sorry, User or Password is Wrong !", vbExclamation, "Warning"
With Text1
.SelStart = 0
.SelLength = Len(Text1)
.SetFocus
End With
Text2 = ""
If n > 3 Then
MsgBox "Sorry, you're have a 3x Wrong, Application will Close!", 64, "Information"
End
End If
End If

Demikian salah satu cara untuk membuat form login pada VB 6.0, Semoga bermamfaat bagi anda yang sedang belajar Visual Basic.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Popular Post

About

LINK SOBAT

Tips, Triks AdSense, Tutorial Blog, Free Download E-Book, Bisnis Penghasil Dollar, cara buka Paypal/Alertpay, tips google adsense, bisnis internet, pusat bisnis online, pulsamurah

COBADIBACA.COM

- Copyright © Debugers -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -