ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 1st, 2003, 03:03 PM
fishbulb fishbulb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Ocean State
Posts: 6 fishbulb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Creating session variable

Working on a survey with results going into an Access (2002) database. Each survey-taker would be a new, unique entry in the survey-taker table, and the primary key is set as an autonumber.

The survey is several pages long, and I need a way for the autonumbered primary key to carry over to each page in order to keep the results together. Here is my question:

Would creating a session variable tied to the primary key work, or am I going about this all wrong? If a session variable would work, how do I tie it to an autonumber?

Thanks in advance.

Reply With Quote
  #2  
Old April 3rd, 2003, 02:41 PM
defjamninja defjamninja is offline
Overly white
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Fresno, CA
Posts: 83 defjamninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
A session variable would work also I'm assuming your using a form so you could also use a hidden field and store the value of the primary key there. Anyway this is how you could use a session.

Code:
Session("SurveyKey") = Recordset.Fields("PrimaryKey")


That will create a session.

So what you would do is on the first page you open the recordset and create a new record. Then return the value of the primary key and store in in a session like the code above.

On all that survey pages do a query sorta like
Code:
"SELECT * FROM tblSurvey WHERE PrimaryKey = " & session("SurveyKey")


If there are lots of questions then you might only want to return the fields on the current page. Anyway good luck.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Creating session variable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway