dupe records on refresh

Discussion in 'ASP General' started by 2obvious, Feb 11, 2005.

  1. 2obvious

    2obvious Guest

    Despite my best efforts, I cannot prevent bogus duplicate records in my
    database. I have a routine that compares against similarities,
    presenting an alert page with examples when there is a regular
    expression match. It works brilliantly.

    Get beyond this page, however, and anytime one submits, goes back in
    history, and submits again, there is a duplicate. (Questioning why
    someone would do this will not solve my problems--I'm just trying to
    make things bulletproof.)

    I can only think of two methods to solve my problem, neither of which
    seems practical. I was hoping for some outside insight.

    Method 1: kill the browser history, making it impossible for my users
    to go back and resubmit. Due to security issues, the only way I know
    of pulling this off is indirect and annoying: a pop-up.

    Method 2: check every field of every record for an identical match each
    time. This would probably slow the server to a crawl.

    I'm using hidden form fields to pass data, if it helps. But I'm
    storing them in a globally-used server side include. I did a brief
    experiment with saving to a session variable and got the same results.
    But I don't have any experience with session variables, so perhaps I
    didn't try hard enough?
     
    2obvious, Feb 11, 2005
    #1
    1. Advertising

  2. 2obvious wrote:
    > Despite my best efforts, I cannot prevent bogus duplicate records in
    > my database. I


    Preventing duplicates is what your database's primary key and/or unique
    index is for. It is folly to attempt to use application code to do your
    database's job. Your database should be designed to protect your data's
    integrity. Given that you're telling us that duplicates are being allowed, I
    can pretty much guarantee that your database design is flawed.

    Post some details and maybe somebody will have some suggestions.


    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Feb 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke Airig
    Replies:
    0
    Views:
    821
    Luke Airig
    Dec 31, 2003
  2. Larry Bud

    Finding Dupe in a List

    Larry Bud, Jul 30, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    587
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 31, 2007
  3. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    486
    Ray at
    May 10, 2004
  4. Replies:
    3
    Views:
    706
    Anthony Jones
    Nov 2, 2006
  5. J Krugman
    Replies:
    1
    Views:
    110
    KKramsch
    Nov 25, 2004
Loading...

Share This Page