Database entry - avoiding duplicate records

This is a discussion on Database entry - avoiding duplicate records within the Tech Board forums, part of the Community Boards category; I'm working on a web application, and the application allows people to enter, edit, and search for people. I have ...

  1. #1
    Chad Johnson
    Join Date
    May 2004
    Posts
    154

    Database entry - avoiding duplicate records

    I'm working on a web application, and the application allows people to enter, edit, and search for people. I have one table that stores all people, and an autonumber is automatically assigned to a person when they are entered. Therefore, since I'm using an autonumber as a primary key, there is the possibility that a person can be duplicated.

    I want to avoid duplicates as much as possible. I've thought of 2 solutions, but I'd really like to hear more. Here's what I have:
    1. Don't provide the user with a link to the entry page until they've ran a search (i.e., the link to the entry page is on the search page).
    2. After submission on the entry page and before the record is written, show a list of possible candidates for the information that was entered. If the person already exists, they can cancel the entry process.


    What are some other techniques I can use to avoid duplicate names?
    Last edited by ChadJohnson; 02-03-2006 at 04:18 PM.

  2. #2
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    I'd go with something akin to option 2. Whenever a name is submitted, do a search, and if you come up with a match, offer the user the chance to select from the matches. If there is no collision, then enter a new record without further prompting.
    Insert obnoxious but pithy remark here

  3. #3
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    And what do you call a duplicate person?
    There's thousands of people with the same name, so that can't be it (at one stage there were 3 people with the exact same first AND last name working in the company that employs me, which at that stage was about 60 people total. Now that's extreme but you get the point).

    And some people might have outdated information about someone, so they won't recognise that person when he's listed, leading to duplicate information anyway (2 entries for one person with a different address for example).

    You can never fully prevent it, no matter what you do.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. literature database: help with planning
    By officedog in forum C++ Programming
    Replies: 1
    Last Post: 01-23-2009, 11:34 AM
  2. reading a file into a block
    By mickey0 in forum C++ Programming
    Replies: 19
    Last Post: 05-03-2008, 05:53 AM
  3. Database assignment is Killing me!
    By Boltrig in forum C Programming
    Replies: 2
    Last Post: 11-29-2007, 02:56 AM
  4. Binary Search Tree
    By penance in forum C Programming
    Replies: 4
    Last Post: 08-05-2005, 05:35 PM
  5. Adding records to a 2 dimensional database.
    By colinuk in forum C Programming
    Replies: 7
    Last Post: 01-16-2005, 06:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21