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. C#
  4. Who gets the priority to access when 2 users try to connect to?

Who gets the priority to access when 2 users try to connect to?

Scheduled Pinned Locked Moved C#
databasequestion
4 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.
  • G Offline
    G Offline
    Gali1978
    wrote on last edited by
    #1

    if 2 users connect to access and run query that check the last number increase this number and insert record to database. Who gets the priority ? why i see 2 duplicate records with the same number ? thanks in advance

    P N 2 Replies Last reply
    0
    • G Gali1978

      if 2 users connect to access and run query that check the last number increase this number and insert record to database. Who gets the priority ? why i see 2 duplicate records with the same number ? thanks in advance

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      It sounds like you need a transaction; that's what they're for. I also don't recommend Access. X|

      1 Reply Last reply
      0
      • G Gali1978

        if 2 users connect to access and run query that check the last number increase this number and insert record to database. Who gets the priority ? why i see 2 duplicate records with the same number ? thanks in advance

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        What you need in this case is an auto-incremented number, such as a primary key, rather than relying on a number field which must be manually incremented. You could also increment the number when inserting the record, not before. I also agree with PIEBALDconsult, don't use Access. SQL Express is FREE and more robust than Access in multi-user scenarios. It also easier to upgrade to a full SQL Server implementation when necessary.


        I know the language. I've read a book. - _Madmatt

        P 1 Reply Last reply
        0
        • N Not Active

          What you need in this case is an auto-incremented number, such as a primary key, rather than relying on a number field which must be manually incremented. You could also increment the number when inserting the record, not before. I also agree with PIEBALDconsult, don't use Access. SQL Express is FREE and more robust than Access in multi-user scenarios. It also easier to upgrade to a full SQL Server implementation when necessary.


          I know the language. I've read a book. - _Madmatt

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Mark Nischalke wrote:

          auto-incremented number

          X|

          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