Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Try
- Dim conn As OleDbConnection = New OleDbConnection(My.Resources.ConnectionString)
- Dim cmd As OleDbCommand
- conn.Open()
- Dim Sql As String = "select * from Administretor"
- cmd = New OleDbCommand(Sql, conn)
- Dim userE, userR As String
- userE = txtOldPass.Text
- Dim reder As OleDbDataReader = cmd.ExecuteReader()
- While reder.Read()
- userR = reder.Item(0)
- End While
- If userE = userR Then
- If txtNewPass.Text = txtNewConfromPass.Text And txtNewConfromPass.Text <> "" And txtNewPass.Text <> "" Then
- Sql = "UPDATE Administretor SET PASSWORD='" & txtNewPass.Text & " where LogIn_id=" & txtOldPass.Text & ""
- Dim cmd0 As OleDbCommand = New OleDbCommand(Sql, conn)
- cmd0.ExecuteNonQuery()
- Else
- MsgBox("Make sure that you have entered new password in both text Box and they both are same...!")
- End If
- Else
- MsgBox("Enter the correct Username")
- End If
- MsgBox("Done 2")
- Catch ex As OleDbException
- MsgBox(ex.Message)
- End Try
- "UPDATE Administretor SET PASSWORD='" & txtNewPass.Text & " where LogIn_id=" & txtOldPass.Text & ""
- ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- Missing single quote here---+ |
- |
- LogIn_Id will never equal the old password--------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement