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. General Programming
  3. Visual Basic
  4. Updating Table of Access Database

Updating Table of Access Database

Scheduled Pinned Locked Moved Visual Basic
helpdatabaseagentic-aiquestionannouncement
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.
  • K Offline
    K Offline
    keninfo
    wrote on last edited by
    #1

    Hello all, I know it seems stupid, but i just cannot update a table of my access database. I get an error: In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user. The parameter (and then the value of my Agentnummer textbox) has no default value This is the code: daAgent.UpdateCommand.CommandText = ("UPDATE Agent " & _ "SET Agentnummer = " & txtAgentnummer.Text & ", " & "Agentnaam = " & txtAgentnaam.Text & _ " WHERE Agentnummer = " & agentNummerOud) daAgent.UpdateCommand.Connection.Open() daAgent.UpdateCommand.ExecuteNonQuery() daAgent.UpdateCommand.Connection.Close() Maybee this is not the right code at all for updating a table. Is there anyone who can help? Thanks!!!

    C 1 Reply Last reply
    0
    • K keninfo

      Hello all, I know it seems stupid, but i just cannot update a table of my access database. I get an error: In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user. The parameter (and then the value of my Agentnummer textbox) has no default value This is the code: daAgent.UpdateCommand.CommandText = ("UPDATE Agent " & _ "SET Agentnummer = " & txtAgentnummer.Text & ", " & "Agentnaam = " & txtAgentnaam.Text & _ " WHERE Agentnummer = " & agentNummerOud) daAgent.UpdateCommand.Connection.Open() daAgent.UpdateCommand.ExecuteNonQuery() daAgent.UpdateCommand.Connection.Close() Maybee this is not the right code at all for updating a table. Is there anyone who can help? Thanks!!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You're not putting quotes around the string. Your code is also open to SQL injection attacks. PErsonally, I don't get why anyone uses these update command things, I thnk they suck.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      K 1 Reply Last reply
      0
      • C Christian Graus

        You're not putting quotes around the string. Your code is also open to SQL injection attacks. PErsonally, I don't get why anyone uses these update command things, I thnk they suck.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        K Offline
        K Offline
        keninfo
        wrote on last edited by
        #3

        What kind of command do you suppose?

        C 1 Reply Last reply
        0
        • K keninfo

          What kind of command do you suppose?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I would write a proper data layer, all my SQL in stored procs, and then call the methods as I needed them.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          K 1 Reply Last reply
          0
          • C Christian Graus

            I would write a proper data layer, all my SQL in stored procs, and then call the methods as I needed them.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            K Offline
            K Offline
            keninfo
            wrote on last edited by
            #5

            Ok, i see. There is a lot to learn for me. Thanks for the reply.

            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