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. updateing problem

updateing problem

Scheduled Pinned Locked Moved Database
databasehelpcsharpquestion
11 Posts 3 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.
  • A Offline
    A Offline
    asha_s
    wrote on last edited by
    #1

    hi every one i have problem when i update my database my primry key is three column how can i write my sql statment i am programing using access db and vb.net when i write sql="update [Section] set Cap=4 where Sectionid=123 and techid=123" it give error and when i but sectionid only it also give error

    A 1 Reply Last reply
    0
    • A asha_s

      hi every one i have problem when i update my database my primry key is three column how can i write my sql statment i am programing using access db and vb.net when i write sql="update [Section] set Cap=4 where Sectionid=123 and techid=123" it give error and when i but sectionid only it also give error

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      It would help if you said what error, but I'll hazard a guess that you are trying to create a duplicate key. Check that you don't already have a record where Cap=4 and Sectionid=123 and techid=123

      Bob Ashfield Consultants Ltd

      A 1 Reply Last reply
      0
      • A Ashfield

        It would help if you said what error, but I'll hazard a guess that you are trying to create a duplicate key. Check that you don't already have a record where Cap=4 and Sectionid=123 and techid=123

        Bob Ashfield Consultants Ltd

        A Offline
        A Offline
        asha_s
        wrote on last edited by
        #3

        yes, their will be duplicate because i can not but "and techid=123" in the sql it give error that it can not know what is after Sectionid=123 so i am asking about how can i write this thanks

        K 1 Reply Last reply
        0
        • A asha_s

          yes, their will be duplicate because i can not but "and techid=123" in the sql it give error that it can not know what is after Sectionid=123 so i am asking about how can i write this thanks

          K Offline
          K Offline
          Kevin Brydon
          wrote on last edited by
          #4

          i think the real challenge is trying to figure out what your question is.

          A A 2 Replies Last reply
          0
          • K Kevin Brydon

            i think the real challenge is trying to figure out what your question is.

            A Offline
            A Offline
            asha_s
            wrote on last edited by
            #5

            hi this is the error Syntax error (missing operator) in query expression 'SectionID = 847 AND'. and sectionid is number

            A 1 Reply Last reply
            0
            • A asha_s

              hi this is the error Syntax error (missing operator) in query expression 'SectionID = 847 AND'. and sectionid is number

              A Offline
              A Offline
              Ashfield
              wrote on last edited by
              #6

              I suspect you have some charater datatypes, you need to encluse the values in quotes sectionid = '123' etc

              Bob Ashfield Consultants Ltd

              A 1 Reply Last reply
              0
              • K Kevin Brydon

                i think the real challenge is trying to figure out what your question is.

                A Offline
                A Offline
                Ashfield
                wrote on last edited by
                #7

                True, but its better than this one :rolleyes: http://www.codeproject.com/script/Forums/View.aspx?fid=1725&msg=2567215[^]

                Bob Ashfield Consultants Ltd

                1 Reply Last reply
                0
                • A Ashfield

                  I suspect you have some charater datatypes, you need to encluse the values in quotes sectionid = '123' etc

                  Bob Ashfield Consultants Ltd

                  A Offline
                  A Offline
                  asha_s
                  wrote on last edited by
                  #8

                  but sectionid of type number not text:confused:

                  A 1 Reply Last reply
                  0
                  • A asha_s

                    but sectionid of type number not text:confused:

                    A Offline
                    A Offline
                    Ashfield
                    wrote on last edited by
                    #9

                    Post your table create script and then I'll see what I can do

                    Bob Ashfield Consultants Ltd

                    A 1 Reply Last reply
                    0
                    • A Ashfield

                      Post your table create script and then I'll see what I can do

                      Bob Ashfield Consultants Ltd

                      A Offline
                      A Offline
                      asha_s
                      wrote on last edited by
                      #10

                      thanks, but i found the solution

                      A 1 Reply Last reply
                      0
                      • A asha_s

                        thanks, but i found the solution

                        A Offline
                        A Offline
                        Ashfield
                        wrote on last edited by
                        #11

                        asha_s wrote:

                        thanks, but i found the solution

                        which was?

                        Bob Ashfield Consultants Ltd

                        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