Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ms access 2007 update query?

ms access 2007 update query?

Scheduled Pinned Locked Moved Database
csharpdatabasecomsecurityhelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    murali_utr
    wrote on last edited by
    #1

    hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance

    Have A Nice Day! Murali.M Blog

    L D 2 Replies Last reply
    0
    • M murali_utr

      hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance

      Have A Nice Day! Murali.M Blog

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      "Password" is a reserved keyword[^] and hence, not a good name for a column.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      1 Reply Last reply
      0
      • M murali_utr

        hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance

        Have A Nice Day! Murali.M Blog

        D Offline
        D Offline
        Dineshshp
        wrote on last edited by
        #3

        i think u r missing a statement... m_thisCommand.CommandType = CommandType.Text; please try this,,,

        DineshT

        J 1 Reply Last reply
        0
        • D Dineshshp

          i think u r missing a statement... m_thisCommand.CommandType = CommandType.Text; please try this,,,

          DineshT

          J Offline
          J Offline
          Jorgen Andersson
          wrote on last edited by
          #4

          Commandtype.text is default and does not need to be specified. Oh, and Txtspeak is considered immature and shouldn't be used in professional context.

          Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups