Hi!
Just one thought about table design:
I would to this (for practical reasons)
tbl_answers only needs a few fields and makes it easier to handle during
insert:
UserID
QuestionID
Answer
That way each page inserts 5 answers=5 records rather than creating one
record at the beginning and updating for every question page....unless you
want to give the user a possibility to change an answer allready given, then
I am in deep **** ;-)
Just the thought of making SQL statement with some 100 fields makes me
tremble :-)
Hakan
-----Ursprungligt meddelande-----
Från: Giovanni Salucci [mailto:g.salucci@n...]
Skickat: den 16 februari 2002 15:07
Till: ASP Databases
Ämne: [asp_databases] R: Re: FOR....LOOP
assuming you are using a database (access or sqlserver) the schema may be:
THE DATABASE
table questions (you store questions)
id_question (int)
question (text or memo)
table user (you store here the registration of users)
iduser (int autonumber)
user (text) you store name and surname
table answers
idrecord (int autonumber)
iduser (int) related with user table
ans01 (text)
ans02 (text)
....
ans100 (text)
ASP files
you need only some files:
1) form registration, in which you ask for user data and pass data to
regisytration.asp
2) registration.asp which validate user data and insert them in database,
then redirect to questionpage
3) question form display 5 questions of database. to control which answer
display you might use a Session variable
or use querystring. Submitting the form redirect to insert.asp
4) insert.asp validate the answers, insert them in table answers, then
redirect to question.asp for next displaying
or to final page when all questions are displayed
5) final page: you need thanks user to answering lot of pages!!!
remember you need pass from a page to another the iduser to update the
record...
HTH
Giovanni
-----Messaggio originale-----
Da: Linday Bakharia [mailto:lindsay_bakharia@h...]
Inviato: sabato 16 febbraio 2002 13.50
A: ASP Databases
Oggetto: [asp_databases] Re: FOR....LOOP
Sorry my message wasn't clear enough. My goal is to display 5 questions
on each page and have a NEXT button at the end of each page to allow the
user to go to the next page until all the questions are addressed.
> Hi,
>
> I am building a data driven Survey application. It's a long survey (100
> questions) and I would like to display 5 questions on each page. I was
> sucessfully written a page that could display all the questions and
values
> on the web. I know a For....Loop would do it but since I am new to
asp,
> it's like a pain in neck.
>
> I would appreciate if you can give me a line of code or a site where I
can
> learn how to do this.
>
>
$subst('Email.Unsub').
$subst('Email.Unsub').