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. Access db autonumber

Access db autonumber

Scheduled Pinned Locked Moved Visual Basic
databaseregexquestion
3 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.
  • Z Offline
    Z Offline
    ziperzappper
    wrote on last edited by
    #1

    I amhaving problems with my db connection. In a form connected to the db through a table adaptor if i restore using CancelEdit, and then add new again the dataset retains the next sequential autonumber. i.e addnew id is 79, restore, addnew id is 80, when no 79 was actually created in the access db. I have tried restore etc to no avail. How can i reset the dataset to match the current autonumbers in the db. Thanks

    M 1 Reply Last reply
    0
    • Z ziperzappper

      I amhaving problems with my db connection. In a form connected to the db through a table adaptor if i restore using CancelEdit, and then add new again the dataset retains the next sequential autonumber. i.e addnew id is 79, restore, addnew id is 80, when no 79 was actually created in the access db. I have tried restore etc to no avail. How can i reset the dataset to match the current autonumbers in the db. Thanks

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      First - why do you care what happened to ID 79 as long as the record was not saved. Second - learn about ID fields, they should not have a use other than identifying the record. If your system is failing because there is no 79 you are using 79 for other than id. STOP. This is a classic mistake all new programmers encounter.

      Never underestimate the power of human stupidity RAH

      Z 1 Reply Last reply
      0
      • M Mycroft Holmes

        First - why do you care what happened to ID 79 as long as the record was not saved. Second - learn about ID fields, they should not have a use other than identifying the record. If your system is failing because there is no 79 you are using 79 for other than id. STOP. This is a classic mistake all new programmers encounter.

        Never underestimate the power of human stupidity RAH

        Z Offline
        Z Offline
        ziperzappper
        wrote on last edited by
        #3

        The reason i care :P is that when you try to delete the newly created record it uses the id as its Id into the back end (Db), there is no match so i get an error every time. so 79 in the dataset is actually say 77 in the Access db (Autonumber). In an ideal world this wouldn't happen however.. BTW yes i am new (trying to self teach) but am aware that an id is just that, a record placer.

        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