Assign Session ID in FrontPage2003

M

M Bennett

Hi,
I am creating a survey in FP 2003 and have 7 pages that each store to
separate database files in Access. I need to be able to assign some sort of
identifier (a Session ID, perhaps?) so that I will be able to track the same
user as they go through all 7 pages of my survey and link their results from
each page (I can't collect their name or any otherwise identifying
information). Unfortunately, I have been unable to figure out how to create
such a variable. When I created the database, FP inserted a variable called
"UserName", but this always comes up as blank in Access.

Could anyone please provide a suggestion for how to assign a SessionID
number to each participant in the survey that would track all 7 pages?

Thanks SO MUCH in advance for your help!!!

Best wishes,
M. Bennett
 
P

p c

There are several ways to achieve what you want. But if I understand you
correctly, you say you have:

* 7 pages
* each page has one form
* each form submits to a different database file (total of 7)
* you want to store a "user key" for each form to be able to link the
data from all forms to the same user.

If I were you I would re-think the survey design and the database
design. Is a reason why you use 7 db files?

Consider these:
Use only one DB file.
Use only one DB table for the survey if you don't have a reason to keep
the form results in separate tables. This way you have a;l the survey
answers for each user in a single record in one table--not spread over 7
tables. If you need them in separate tables you will need to have an
extra relational key in each tale (say struser) to store the user unique
ID and be able to do join queries to view a complete survey per user.

Do you need to separate the form in 7 separate pages? If not, you
eliminate the complexities of having to track sate between pages.

For what you are trying to do, you need flexibility the flexibility of
hand coding and script.

For passing information between forms you can do it with hidden from
fields, sessions or cookies. The problem with sessions is that if the
user takes too long (about 20 min.) to submit the form the session will
expire and you lose the unique key

Here's how to do it with ASP and hidden form field.

Form1.asp has the first form, creates the unique ID and submits to
Form2.asp. You decide what to store, for example if you can use
IPadres+date+time

<%
strUser= Request.ServerVariables("REMOTE_ADDR") & Now()
%>
<INPUT TYPE=hidden NAME=strUser VALUE="<%=strUser%>">

Form2.asp submits the results of form1, including strUser,
to the DB, and presents Form2.

Form3.asp submits form2 and presents Form3. And so on.

...PC
 
T

Thomas A. Rowe

FYI: As long as the survey user doesn't site idle more then 20 minutes on anyone page. A user would
have
about 135 minutes (19 minutes per page) to complete the survey when using Sessions.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
S

Stefan B Rusynko

PS
The initial variable "strUser" as a hidden form field named strUser,
(once created on form1.asp per pc post),
can be passed from form to form on each subsequent form just using
<INPUT TYPE=hidden NAME=strUser VALUE="<%=Request.Form("strUser%"%>">

You can use the concatenated string created by Request.ServerVariables("REMOTE_ADDR") & Now() for strUser,
Or you can use the ASP Session ID as an identifier
- which will be unique to each user for that session & not require the forms to be chained
- See http://www.devguru.com/Technologies/asp/quickref/session_sessionid.html

In form1 before the form set
<% Session("UID")=Session.SessionID %>
Then in any of the forms use
<INPUT TYPE=hidden NAME=strUser VALUE="<%=Session("UID")%>">



| There are several ways to achieve what you want. But if I understand you
| correctly, you say you have:
|
| * 7 pages
| * each page has one form
| * each form submits to a different database file (total of 7)
| * you want to store a "user key" for each form to be able to link the
| data from all forms to the same user.
|
| If I were you I would re-think the survey design and the database
| design. Is a reason why you use 7 db files?
|
| Consider these:
| Use only one DB file.
| Use only one DB table for the survey if you don't have a reason to keep
| the form results in separate tables. This way you have a;l the survey
| answers for each user in a single record in one table--not spread over 7
| tables. If you need them in separate tables you will need to have an
| extra relational key in each tale (say struser) to store the user unique
| ID and be able to do join queries to view a complete survey per user.
|
| Do you need to separate the form in 7 separate pages? If not, you
| eliminate the complexities of having to track sate between pages.
|
| For what you are trying to do, you need flexibility the flexibility of
| hand coding and script.
|
| For passing information between forms you can do it with hidden from
| fields, sessions or cookies. The problem with sessions is that if the
| user takes too long (about 20 min.) to submit the form the session will
| expire and you lose the unique key
|
| Here's how to do it with ASP and hidden form field.
|
| Form1.asp has the first form, creates the unique ID and submits to
| Form2.asp. You decide what to store, for example if you can use
| IPadres+date+time
|
| <%
| strUser= Request.ServerVariables("REMOTE_ADDR") & Now()
| %>
| <INPUT TYPE=hidden NAME=strUser VALUE="<%=strUser%>">
|
| Form2.asp submits the results of form1, including strUser,
| to the DB, and presents Form2.
|
| Form3.asp submits form2 and presents Form3. And so on.
|
| ..PC
|
|
|
| M Bennett wrote:
|
| > Hi,
| > I am creating a survey in FP 2003 and have 7 pages that each store to
| > separate database files in Access. I need to be able to assign some sort of
| > identifier (a Session ID, perhaps?) so that I will be able to track the same
| > user as they go through all 7 pages of my survey and link their results from
| > each page (I can't collect their name or any otherwise identifying
| > information). Unfortunately, I have been unable to figure out how to create
| > such a variable. When I created the database, FP inserted a variable called
| > "UserName", but this always comes up as blank in Access.
| >
| > Could anyone please provide a suggestion for how to assign a SessionID
| > number to each participant in the survey that would track all 7 pages?
| >
| > Thanks SO MUCH in advance for your help!!!
| >
| > Best wishes,
| > M. Bennett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top