Syntax error in UPDATE statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Suresh Mahesh
    New Member
    • Jun 2011
    • 9

    Syntax error in UPDATE statement

    i can't update ms access database

    my code is below


    Code:
    con.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=J:\1111\11111\VMS.accdb")
    
     con.Open()
    
           
     Dim sql As String = "update login set password='11111', where username='suresh'"
    
            Dim objCmd As OleDbCommand
            objCmd = New OleDbCommand(sql, con)
            'objCmd.Connection.Open()
            objCmd.ExecuteNonQuery()//hear error occurred
            con.Close()
    <edit: e-mail address removed>



    please answer me
    Last edited by Stewart Ross; Jun 23 '11, 08:42 PM. Reason: e-mail address removed
  • Jason Kibble
    New Member
    • Jun 2011
    • 4

    #2
    Try removing the comma after the pasword value. You are only trying to set a single value, so there is no need for a comma.

    Comment

    • Suresh Mahesh
      New Member
      • Jun 2011
      • 9

      #3
      thank you .. its working

      Comment

      Working...