I am doing assignments from campus to make payroll program and my assignment is now 90% almost done. But I encountered a problem when making a password replacement form, I have tried various methods, but they didn't work. I'm use microsoft access database (mdb).
Sorry if my English is bad. Please help.
This is my coding :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Call Koneksi()
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
MsgBox("Password masih kosong", vbExclamation + vbOKOnly, "Pesan")
Exit Sub
End If
If TextBox3.Text <> TextBox2.Text Then
MsgBox("Password konfirmasi salah")
TextBox3.Focus()
Else
If MessageBox.Show("Yakin akan ganti Password..?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
Dim SqlCMD As New OleDbCommand
SqlCMD.Connection = DataBase
SqlCMD.CommandType = CommandType.Text
SqlCMD.CommandText = "UPDATE Pengguna set Password = '" & TextBox2.Text & "' where Kode_Pengguna = '" & Label4.Text & "'"
SqlCMD.ExecuteNonQuery()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
Me.Close()
Else
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
Me.Close()
End If
End If
End Sub