3 Replies - 2215 Views - Last Post: 26 August 2012 - 11:17 PM Rate Topic: -----

#1 lancomi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 17-August 12

question about autonumber database

Posted 17 August 2012 - 08:24 AM

hello, I'm here to ask again, sorry to bother you guys,
I have these database in access and I assign a autonumber field as my primary key,
I already have the code for add,edit,delete and save,
my question is for example I delete a data in which "3" is the primary key,
my database table record will now be in 1-2-4-5,
is it possible to update my database table in access so it will become 1-2-3-4 after I delete data "3" instead of 1-2-4-5?
sorry for my bad english,
thank you :)

Is This A Good Question/Topic? 0
  • +

Replies To: question about autonumber database

#2 anbarasan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-September 07

Re: question about autonumber database

Posted 26 August 2012 - 06:21 AM

MS Access
I hope this article will help your doubt..
Was This Post Helpful? 0
  • +
  • -

#3 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4354
  • View blog
  • Posts: 12,160
  • Joined: 18-April 07

Re: question about autonumber database

Posted 26 August 2012 - 07:45 PM

Honestly you should really never want to do this. Who cares if the auto number is missing values. Autonumber fields, especially ones used for a primary key, is only for getting numbers that are unique... in other words, an identifier. All they really are is to identify the row from all the others in the table.

You may actually run into issues if you also have other tables that connect to this one through the key. Rather than trying to reset it and possibly hoop your database, I would just ignore it. If you need to display the sequential order, then make another field which is not a key and resequence that.

That is just my advice. :)
Was This Post Helpful? 1
  • +
  • -

#4 anbarasan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-September 07

Re: question about autonumber database

Posted 26 August 2012 - 11:17 PM

hearty thanks Martyr2 ..
already face this trouble later i find the solution ..
above the link exactly working..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1