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. AutoIncrement

AutoIncrement

Scheduled Pinned Locked Moved Database
2 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.
  • V Offline
    V Offline
    vuthaianh
    wrote on last edited by
    #1

    I inserted three records into table Products(ProductID, ProductName) with ProductID set to AutoIncrement. Three records with ProductID were 1, 2, 3. After that i deleted three recored and insert the fourth record. This record would got the the productID's value is 4 How could i set the ProdudctID of this record to 1, just like the beginning. Thanks

    S 1 Reply Last reply
    0
    • V vuthaianh

      I inserted three records into table Products(ProductID, ProductName) with ProductID set to AutoIncrement. Three records with ProductID were 1, 2, 3. After that i deleted three recored and insert the fourth record. This record would got the the productID's value is 4 How could i set the ProdudctID of this record to 1, just like the beginning. Thanks

      S Offline
      S Offline
      S Douglas
      wrote on last edited by
      #2

      vuthaianh wrote:

      How could i set the ProdudctID of this record to 1, just like the beginning.

      I’m guessing you’re using MS Access; the only way to re-start the counter is to compact / repair the database. It only works when there are no other data connections open and when no records exist in the table. Hope this helps.


      ZeePain! wrote:

      This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.

      thedailywtf.com[^]

      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