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. Web Development
  3. ASP.NET
  4. syntax error in update statement

syntax error in update statement

Scheduled Pinned Locked Moved ASP.NET
helpdatabasesysadminannouncement
5 Posts 2 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.
  • S Offline
    S Offline
    sandeep_thakur
    wrote on last edited by
    #1

    Sir, I am using the update query and there is occuring the problem There is a syntax error in update statement. str = "Provider = Microsoft.jet.Oledb.4.0;Data Source =" + Server.MapPath("\sandeep\sujok\sujok.mdb") con = New OleDbConnection(str) con.Open() Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & '" cmd = New OleDbCommand(sdd, con) cmd.ExecuteNonQuery() con.Close Please sort out the problem Plese send me some code if possible Thanks and Regards sandeep Thakur -- modified at 4:27 Friday 19th May, 2006

    _ 1 Reply Last reply
    0
    • S sandeep_thakur

      Sir, I am using the update query and there is occuring the problem There is a syntax error in update statement. str = "Provider = Microsoft.jet.Oledb.4.0;Data Source =" + Server.MapPath("\sandeep\sujok\sujok.mdb") con = New OleDbConnection(str) con.Open() Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & '" cmd = New OleDbCommand(sdd, con) cmd.ExecuteNonQuery() con.Close Please sort out the problem Plese send me some code if possible Thanks and Regards sandeep Thakur -- modified at 4:27 Friday 19th May, 2006

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      Hi Sandeep, you use like this Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & "'" Hope this will help. But this is not the correct way by this you are giving a chance for sql injection. Use parameters for this. Best Regards, Apurva Kaushal

      S 1 Reply Last reply
      0
      • _ _AK_

        Hi Sandeep, you use like this Dim sdd As String = "Update admin Set password ='" & TextBox3.Text & "' where user_id = '" & TextBox1.Text & "' and password = '" & TextBox2.Text & "'" Hope this will help. But this is not the correct way by this you are giving a chance for sql injection. Use parameters for this. Best Regards, Apurva Kaushal

        S Offline
        S Offline
        sandeep_thakur
        wrote on last edited by
        #3

        Thanks But There is same problem Error is --- ( syntex error in UPDATE statement) Please help me

        _ 1 Reply Last reply
        0
        • S sandeep_thakur

          Thanks But There is same problem Error is --- ( syntex error in UPDATE statement) Please help me

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          Hi, Are you getting this error in database or in the front end? Best Regards, Apurva Kaushal

          S 1 Reply Last reply
          0
          • _ _AK_

            Hi, Are you getting this error in database or in the front end? Best Regards, Apurva Kaushal

            S Offline
            S Offline
            sandeep_thakur
            wrote on last edited by
            #5

            Thank You very much i found the solution once again thank you

            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