Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Try
  2. Dim conn As OleDbConnection = New OleDbConnection(My.Resources.ConnectionString)
  3. Dim cmd As OleDbCommand
  4.  
  5. conn.Open()
  6.  
  7. Dim Sql As String = "select * from Administretor"
  8. cmd = New OleDbCommand(Sql, conn)
  9.  
  10. Dim userE, userR As String
  11. userE = txtOldPass.Text
  12.  
  13. Dim reder As OleDbDataReader = cmd.ExecuteReader()
  14.  
  15. While reder.Read()
  16. userR = reder.Item(0)
  17. End While
  18.  
  19. If userE = userR Then
  20. If txtNewPass.Text = txtNewConfromPass.Text And txtNewConfromPass.Text <> "" And txtNewPass.Text <> "" Then
  21. Sql = "UPDATE Administretor SET PASSWORD='" & txtNewPass.Text & " where LogIn_id=" & txtOldPass.Text & ""
  22.  
  23. Dim cmd0 As OleDbCommand = New OleDbCommand(Sql, conn)
  24. cmd0.ExecuteNonQuery()
  25. Else
  26. MsgBox("Make sure that you have entered new password in both text Box and they both are same...!")
  27. End If
  28. Else
  29. MsgBox("Enter the correct Username")
  30. End If
  31.  
  32. MsgBox("Done 2")
  33. Catch ex As OleDbException
  34. MsgBox(ex.Message)
  35. End Try
  36.  
  37. "UPDATE Administretor SET PASSWORD='" & txtNewPass.Text & " where LogIn_id=" & txtOldPass.Text & ""
  38. ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  39. | |
  40. Missing single quote here---+ |
  41. |
  42. LogIn_Id will never equal the old password--------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement