Solved

Passing SQL 7 and user added data over 4 pages

Posted on 2001-06-02
3
176 Views
Last Modified: 2013-12-24
Using UD 4.01

I have 4 pages that gets data from a SQL7 database (passes using a combo box dropdown) and data from user entry (data collected using edit controls).

Since there is so much data that needs to get collected, I divided the collecting data up into four pages. I need to keep the data values alive until it gets to the last page and then it needs to be display in a table grid. This will give the user the ability to review the data prior to submitting it to the datatbase.

How do I keep the data live so it can pass from page to page until I get to the end? Examples, if possible.

DO I use a session variable? If so how do I set then when some of the content is going to be added by the user?

Thanks in advance.

rb
0
Comment
Question by:routerboy309
3 Comments
 
LVL 15

Accepted Solution

by:
ericpete earned 100 total points
Comment Utility
You create a session variable, using the record number, when you enter the data on the first page. Then, when you go to the second page, you filter the recordset using the session variable.
0
 
LVL 1

Expert Comment

by:dclary
Comment Utility
Best practices usually include being as sessionless as possible. But Eric Pete has the right answer.

In the pre-html portion of the 2nd page, read in the data from the post or get (whichever you're using) and Inset the SQL record. When you get the record number returned, be sure to set a hidden field its value, so you can retrieve it on subsequent pages.

(I use a stored procedure for the insert, so I can write code that returns the identity for me.

So if the user is  entering new data, page one is:

<%
'regular stuff
%>
<html>
<form with a bunch of fields>
</form>
</html>

Page 2 is

<%
sqlstring = "sp_insert "
sqlstring = sqlstring & request.form("field1") & ", "
sqlstring = sqlstring & request.form("etc") & " "
adors = adocon.openrecordset(sqlstring,0,1)
%>
<html>
<form>
<select type=hidden name=Myid value=<% =adors.fields(0).value %>>
<other form objects, blah blah>
</form>

On page 3... it's easy, you have the record number, so instead of inserting the record, update it:

sqlstring = "update mytable, set field2 = " & request.form("field2") & ", etal = " & request.form("etal") & " where IDField = " & request.form("MyID")
adocon.execute sqlstring

And finally, on page four, when you want to present all the entered data, simply retrieve it via the record number you've continued to pass along.

"Select * from mytable where IDfield = " & request.form("myid")


Hope this helps!
0
 

Author Comment

by:routerboy309
Comment Utility
Ok - I see - carry the info over to the next and build the SQL statement as you go..

Thanks

RB
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now