Re: Preventing double posting to Access database
From: Kevin Spencer (kevin_at_takempis.com)
Date: 02/23/04
- Previous message: Rich Palarea: "Re: Access Database Query"
- In reply to: Peter N Roth: "Preventing double posting to Access database"
- Next in thread: Peter N Roth: "Re: Preventing double posting to Access database"
- Reply: Peter N Roth: "Re: Preventing double posting to Access database"
- Messages sorted by: [ date ] [ thread ]
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 > > >
- Previous message: Rich Palarea: "Re: Access Database Query"
- In reply to: Peter N Roth: "Preventing double posting to Access database"
- Next in thread: Peter N Roth: "Re: Preventing double posting to Access database"
- Reply: Peter N Roth: "Re: Preventing double posting to Access database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|