Guest User

Untitled

a guest
Nov 12th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. 'user wants to change password
  2. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  3.  
  4. Dim connection As New OleDbConnection
  5. connection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|db1.accdb;Persist Security Info=True")
  6.  
  7. Try
  8. connection.Open()
  9.  
  10. Dim command As OleDbCommand = connection.CreateCommand
  11. command.CommandType = CommandType.Text
  12. command.CommandText = "Update UserAccount SET Password ='" + TextBox2.Text + "' WHERE Username = User"
  13. command.ExecuteNonQuery()
  14.  
  15. MsgBox("Updated")z
  16.  
  17. TextBox2.Text = ""
  18. TextBox3.Text = ""
  19.  
  20. Catch ex As Exception
  21. MsgBox(ex.Message)
  22. End Try
Add Comment
Please, Sign In to add comment