Results 1 to 4 of 4
  1. #1
    harryklein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    48

    duplicated primary keys

    Hi,
    we have an msaccess database that we use from excel. We write records into it with vba-sql (INSERT INTO) commands.
    In the query we don't populate the ID field as it is set to auto number-type and access adds the ID automatically. We use this application since more then a year,
    and recently we noticed that that the some records have the same ID. It has about 110000 records and we found 4 duplicates, all created in the last week.


    That was a bit shocking. How is it possible? Is there any way to avoid it?
    Thank you

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Are you sure that field is a primary key in the table? You can add an autonumber field without making it the primary key.

  3. #3
    harryklein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    48
    Absolutely good point. I was 100% sure that it is primary key, didn't even think about checking, but you are right, it wasn't set to primary key.
    Thank you.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Glad I could help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Duplicated record including primary key
    By AlPal in forum Access
    Replies: 4
    Last Post: 12-06-2016, 05:26 PM
  2. Use of primary keys
    By Homegrownandy in forum Access
    Replies: 6
    Last Post: 06-29-2015, 01:17 AM
  3. Multiple Primary Keys
    By JonathanOz in forum Access
    Replies: 2
    Last Post: 03-22-2013, 08:32 AM
  4. Primary Keys & Relationships
    By Njliven in forum Programming
    Replies: 4
    Last Post: 12-17-2012, 09:42 AM
  5. How to create two primary keys
    By Shabana123 in forum Database Design
    Replies: 1
    Last Post: 09-08-2012, 05:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums