Imports System.Data
Imports System.Data.OleDb
Public Class frmChangePassword
    Public dbrs As New OleDb.OleDbCommand
    Public Provider As New OleDb.OleDbDataAdapter
    Public dbConn As New OleDb.OleDbConnection
    Private Sub frmChangePassword_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub btnChangePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChangePassword.Click
        Using cn As New OleDbConnection("PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source = login.mdb"), _
         cmd As New OleDbCommand("UPDATE LogInAdmin SET Password= ? WHERE Username= ? ;", cn)
            cmd.Parameters.AddWithValue("?", txtNewPassword.Text)
            cmd.Parameters.AddWithValue("?", txtUsername.Text)
            cn.Open()
            cmd.ExecuteNonQuery()
            MsgBox("Changed")
            cn.Close()
        End Using
    End Sub
End Class
            Asked
            
        
        
            Active
            
        
            Viewed 70 times
        
    -3
            
            
        - 
                    please add more detail about your problem just sharing code would not help – Mubashar Dec 15 '14 at 11:27
1 Answers
1
            
            
        The word PASSWORD is a reserved keyword for MS-Access/JET, you need to use square brackets around it
cmd As New OleDbCommand("UPDATE LogInAdmin SET [Password]= ? WHERE Username= ? ;", cn)
However, it is a bad idea to use these reserved keywords, if it is still possible I suggest to change that field name and learn how to store an hash of the password instead of clear text.
 
     
     
    