Solved

Passing SQL 7 and user added data over 4 pages

Posted on 2001-06-02
3
178 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
ID: 6151009
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
ID: 6238546
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
ID: 6238696
Ok - I see - carry the info over to the next and build the SQL statement as you go..

Thanks

RB
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Location of databasefile in Visual Studio 2015 with Ripple Emulator 1 100
PHP v5.4 and Class 'mysqli' not found  error 8 159
Adobe Certified Expert? 1 104
Column Spacing 3 77
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

773 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