Situs Uang Gratis!

  • SOURCE CODE MEMBUAT FORM LOGIN DI VB 6

    Buatlah Database dari accaes terlebih dahulu dengan extension Db.mdb
    Setelah itu fieldnya dengan nama :
    1. nama tabel password2
    2. id_petugas
    3. nama
    Desain Form :
    Text1 (sebagai username),
    Text2 (sebagai password),
    image1(sebagai form login),
    image2(sebagai logout)
    catatan : image1 dan image2 bisa diganti dengan command button sesuai keinginan anda..

    setelah itu buka form VB masukan codding berikut :

    Dim myConn As New ADODB.Connection
    Dim Rs_User As New ADODB.Recordset

    Private Sub Form_Load()
    myConn.CursorLocation = adUseClient
    myConn.Open "Provider=Microsoft.Jet.OLEDB.4.0 ;Persist Security Info=False ;Data Source=" + App.Path + "\Db.mdb"
    Rs_User.Open "Password2", myConn, adOpenDynamic, adLockPessimistic
    Me.Width = 10
    End Sub
    Private Sub Timer1_Timer()
    Me.Width = Me.Width + 100
    tengah
    If Me.Width >= 4933 Then
        Timer1.Enabled = False
        tengah
    End If
    End Sub

    Public Sub tengah()
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    End Sub

    Private Sub Image1_Click()
    'buat 1 image atau tombol (disini q pake image) untuk tombol LOGIN
    If Text1 = "" Then
        MsgBox "Silahkan Isi Nama User.. ", vbInformation, "Informasi Login.."
        Text1.SetFocus
    ElseIf Text2 = "" Then
        MsgBox "Silahkan Isi Password User..", vbInformation, "Informasi Login.."
        Text2.SetFocus
        Else
        On Error Resume Next
           Rs_User.Find "nama='" & Text1.Text & "'", , adSearchForward, 1
    If Rs_User.EOF Then
            MsgBox "User " & Text1.Text & " Tidak dikenali..!", vbCritical, "Error Login"
            Text1 = ""
            Text2 = ""
            Text1.SetFocus
    Else
    If Text2.Text = Rs_User!id_petugas Then
            Unload Me
            MDIForm1.Show
        Else
            MsgBox "Password yang anda masukan salah..", vbCritical, "Error Login"
            Text2 = ""
            Text2.SetFocus
            End If
        End If
    End If
    End Sub

    Private Sub Image2_Click()
    'buat 1 buah image untuk LOGOUT animasi form
    Do
    Me.Left = Me.Left + 40
    Me.Move Me.Left, Me.Top
    DoEvents
    Loop Until Me.Left > Screen.Width
    Unload Me
    End Sub

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Text2.SetFocus
    End If
    End Sub

2 komentar:

  1. Salam Pramuka....

    Wahhh bagus Baget isinya prient
    Lihat balikyah pya aku...
    http://pramukacbitasikmalaya.blogspot.com/

    Terima kasih.

  2. Blogger mengatakan...

    Did you know that that you can generate cash by locking premium pages of your blog / site?
    Simply open an account on AdWorkMedia and use their Content Locking tool.

Posting Komentar

Pengunjung Blog