Situs Uang Gratis!

  • SOURCE CODE MEMBUAT FORM LOGOUT DI VB 6

    Buat Database dari acces dengan extension Db.mdb
    Fieldnya :
    1. Nama tabel password2
    2. id_petugas
    3. nama
    Desian Form Logout :
    1. Text1 (nama user yang lama)
    2. text2 (password lama)
    3. text3 (nama user baru)
    4. Text4 (Password baru)
    5. image1 (konfirmasi) ' image1 bisa diganti dengan command button sesuai keingianan anda..^^
    6. image2  (logout) ' image1 bisa diganti dengan command button sesuai keingianan anda.


    Kopi Paste Codding berikut :

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

    Private Sub Form_Load()
    On Error Resume Next
        myConn.CursorLocation = adUseClient
        If myConn.State = 1 Then myConn.Close
        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
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    Set myConn = Nothing
    End Sub

    Private Sub Image2_Click()

    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
    If Text1.Text = "" Then
        Text1.SetFocus
       Else
        On Error Resume Next
           Rs_User.Find "nama='" & Text1.Text & "'", , adSearchForward, 1
    If Not Rs_User.EOF Then
        Text2.Enabled = True
        Text2.SetFocus
        Text1.Enabled = False
        Else
            MsgBox "Nama user tidak dikenali..", vbOKOnly, "Nama User salah"
            Text2.Enabled = False
            Text2.Text = ""
            Text3.Enabled = False
            Text3.Text = ""
            Text4.Enabled = False
            Text4.Text = ""
            Text1.SetFocus
            Text1 = ""
    End If
    End If
    End If
    End Sub

    Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    If Text2.Text = "" Then
        Text2.SetFocus
    Else
        Rs_User.Find "id_petugas='" & Text2.Text & "'", , adSearchForward, 1
    If Not Rs_User.EOF Then
    '        MsgBox "Password dengan nama sandi : " & Text2.Text & " Telah diganti..", vbInformation, "Informasi"
        Text3.Enabled = True
        Text3.SetFocus
        Text2.Enabled = False
        Else
            MsgBox "Password salah, silahkan masukan sekali lagi.. ", vbInformation, "Informasi"
            Text1.Enabled = False
            Text2.SetFocus
            Text2 = ""
    End If
    End If
    End If
    End Sub

    Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    If Text3.Text = "" Then
        Text3.SetFocus
    Else
        Text4.Enabled = True
        Text4.SetFocus
    End If
    End If
    End Sub

    Private Sub Text4_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    If Text4.Text = "" Then
        Text4.SetFocus
    End If
    End If
    End Sub

    Private Sub Image1_Click()
    If Text1 = "" Then
        MsgBox "Silahkan input nama user.. ", vbInformation, "User kosong!"
        Text1.SetFocus
        ElseIf Text2 = "" Then
        MsgBox "Silahkan input Password User..", vbInformation, "Password kosong!"
        Text2.SetFocus
        ElseIf Text3 = "" Then
        MsgBox "Silahkan Isi Password Baru User..", vbInformation, "Password kosong!"
        Text3.SetFocus
        ElseIf Text4 = "" Then
        MsgBox "Silahkan masukan Password Baru sekali lagi..", vbInformation, "Password konfirmasi kosong!"
        Text4.SetFocus
       
    Else
    If Text4 <> Text3 Then
        MsgBox "Password konfirmasi tidak sama..", vbInformation, "Informasi"
        Text4.SetFocus
        Text4 = ""
            Else
            Pesan = MsgBox("Apakah Anda yakin Password yang lama, " & Chr(13) & "Akan digantikan dengan Password yang baru?", vbYesNo, "Informasi Ganti Password.")
    If Pesan = vbYes Then
        Dim editpwd As String
            editpwd = "update Password2 set id_petugas='" & Text4 & "'where nama='" & Text1 & "' and id_petugas='" & Text2 & "'"
            koneksi.Execute editpwd
            Text1.Text = ""
            Text2.Text = ""
            Text3.Text = ""
            Text4.Text = ""
           
                MsgBox "Password Lama telah diganti dengan Password yang Baru..", vbInformation, "Ubah Password Sukses"
            Do
            Me.Left = Me.Left + 40
            Me.Move Me.Left, Me.Top
            DoEvents
            Loop Until Me.Left > Screen.Width
            Unload Me
           
    End If
    End If
    End If
    End Sub

1 komentar:

  1. Blogger mengatakan...

    Did you know that that you can make dollars by locking premium pages of your blog / website?
    All you need to do is join Mgcash and use their Content Locking tool.

Posting Komentar

Pengunjung Blog