Re: Preventing double posting to Access database

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kevin Spencer (kevin_at_takempis.com)
Date: 02/23/04

  • Next message: Rich Palarea: "Re: Database"
    Date: Mon, 23 Feb 2004 16:53:35 -0500
    
    

    Hi Peter,

    Grace and Peace to you!

    This problem isn't due to the FrontPage DRW, nor is it related to the
    database product you're using. The problem is due to the nature of the WWW.
    When a Form is posted, it posts to an application running on the server. In
    this case, the application has instructions to take the form data and insert
    a new record. If the form page is refreshed after the post, the page is
    re-posted (this is the way browsers behave - all of them), and the
    application re-inserts the data. HTTP is stateless, which means that each
    Request/Response from a browser happens "in a vaccuum" so to speak, with no
    prior knowledge of any activity from before.

    There are ways around this, but you won't find them built into the fairly
    simple FrontPage DRW. All of them require custom programming. Some
    alternatives include:

    1. Using a Session variable to keep track of what data was just posted. You
    would have to record ALL of the data in the form, and programmatically
    disallow a re-post if all of the data is the same.
    2. Doing a Response.Redirect from the Server to a different page after the
    data is posted. This ensures that the page which posted the form is one page
    back in the history list. If the page returned is refreshed, it does
    nothing.

    -- 
    HTH,
    Kevin Spencer
    .Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.
    "Peter N Roth" <refusing.spam@mycompany.com> wrote in message
    news:eXIpmEl#DHA.1956@TK2MSFTNGP10.phx.gbl...
    > Our website accepts data posted by clients from forms
    > using the FP generated method="POST" action="--webbot-self--".
    > The data are stored in an Access database.
    >
    > The tables are designed with multiple fields A, B, and C
    > as the primary key, to prevent duplicate records. These
    > fields are xmitted as hidden fields.
    >
    > On rare occasions, duplicate records get posted anyway.
    > It's as if the record is submitted in duplicate simultaneously,
    > from the same client. The Jet engine eats both of them.
    >
    > So what do i do? Move to SQL Server? Lock the database
    > in some way beyond what FP does?
    > -- 
    > Grace + Peace,
    > Peter N Roth
    > Engineering Objects International
    > http://engineeringobjects.com
    >
    >
    >
    

  • Next message: Rich Palarea: "Re: Database"

    Relevant Pages

    • Re: Microcosoft Access
      ... You can have peace. ... Or you can have freedom. ... such as used by WORKS' database. ... > WORD labels uses Access database to create labels. ...
      (microsoft.public.windowsxp.hardware)
    • Re: {OT} spit here
      ... I know mine have been checked against databases, but I don't know if mine have been added to a database. ... Ever applied for a peace officer's job? ... I hold a California Real Estate license, and they took my prints when I applied for the license. ... I had my prints taken for mentoring, soccer and teaching. ...
      (alt.autos.toyota)
    • custom contact form
      ... creating a contact database using office 2000. ... The company is thinking about upgrading to win xp and office xp. ... Grace ... Prev by Date: ...
      (microsoft.public.outlook.program_forms)
    • RE: Text Search
      ... Your Database was created with 'case sensitive' option. ... > I have table for items, some of the Items codes are including text codes. ... > |Islam is peace not Terror| ...
      (microsoft.public.sqlserver.mseq)
    • Re: Getting XP to read Windows 98
      ... create the database on the Win98 one. ... Bruce Chambers ... You can have peace. ... Or you can have freedom. ...
      (microsoft.public.windowsxp.general)