Multi-page ASP Transactions
Hi, I'm working on several data-entry screens for a client (a golf course).
The project I'm working on is a membership systems. I have 3 data entry
screens, as follows:
1. Personal information.. first name, last name, mi, spouse's name/mi,
2. Organization(s) & Address(s) Info
3. Phone Number(s)
Each form has a corresponding table, and table 2 and 3 have a one-to many
relationship to table 1 (ie a member can have 1 or more
addressses/organizations and 1 or more phone numbers). The way I first
invisioned this working is:
1. Enter personal info. the data is POST'ed to an ASP page which writes to
the table, gets the new ID, and redirects to the 2nd screen, passing the id
as a querystring. The ID then gets plugged into a hidden field. The
Organization/Address data then gets POST'ed to another ASP page which puts
the data to the table. in the Onsubmit event of this form, it is asked if
you want to enter another address. if you respond yes, another hidden field
gets populated. This field is then checked in the ASP page, and if its
'yes' (or 1 or whatever), the ASP page redirects back to the previous page
(with the ID in a querystring of course), allowing multiple addresses. if
the user answers no, the ASP page redirects to the phone page. Action
similar to the organiation page occurs for the phone page.
The problem I can see is that a user could enter the personal data, but not
the address/phone, or something similar, so I was starting to think about
transactions. I know that ADO has begintrans, but, you can't close the
connection in the middle of the transaction. I was then thinking if I could
somehow use MTS like this:
1. user first enters a default.asp which starts the transaction and then
redirects to page 1.
2. person fills out page 1, the data gets saved
3. person fills out one or more page 2's, the data gets saved (each time)
4. person fills out one or more page 3's, the data gets saved (each time)
5. page 3 redirects to another ASP which then commits the transaciton.
If there are any errors, or anything unusual between step 1 and the end of
step 5, the whole transaction is rolled back.
Is there any way to do this (easily)? And, please, don't say 'VB (or C++)
COM objects', because I am working on the client's web server remotely, so I
can't install any dll's.
TSR Solutions, Inc.
My views aren't necessarily my employer's.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL