Solved

Passing SQL 7 and user added data over 4 pages

Posted on 2001-06-02
3
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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 reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
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…

696 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