Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Displaying records


Message #1 by "WVerner" <w_verner@h...> on Fri, 21 Mar 2003 17:59:31
Hey all,
i am developin a testing system in which users who have read books, can 
log onto it, find the book they have read, select a test on that book and 
then complete a set of multiple choice questions.

Now presently i have tables in the database: 
Book: that hold info on the book with unique BookID

Test: that holds info about the test with unique TestID, and i also hold 
the bookID (the book that the test refers to)

Question: the actual question, with QuestionID. i also store the TestID 
that it refers to.

THe system will be holding info on 100s of books and tests. I have set it 
up that the user can add info on each of them to the DB. But what they 
have to do is to know the Test or Book ID when they enter the record...

eg. adding a test, they can input the test information but they have to 
know the bookID before they enter it. This isnt the way i want to do 
it....how can i get a better way of doing this?

ie. again if i go to enter a question it will ask them for the testID it 
relates to.... which they must enter.

can anyone suggest anything?
i hope yous understand what im trying to get at! :(

Thanx guys,
Message #2 by Mark Eckeard <meckeard2000@y...> on Fri, 21 Mar 2003 09:57:58 -0800 (PST)
One suggestion:

Allow the user to select a book from a drop down of
the existing books in the DB.  Use a select control,
using the BookID as the value.  When they find their
book, pass the ID to the next page (or whatever you
plan on doing).

If the user does not find the book, allow them to
enter a new one.  Check for the name upon entry.  if
it exists, pass back error along with the BookID.  If
it doesn't, insert the new book and return the new ID.
 Then the user can proceed.

HTH,
Mark.
--- WVerner <w_verner@h...> wrote:
> Hey all,
> i am developin a testing system in which users who
> have read books, can 
> log onto it, find the book they have read, select a
> test on that book and 
> then complete a set of multiple choice questions.
> 
> Now presently i have tables in the database: 
> Book: that hold info on the book with unique BookID
> 
> Test: that holds info about the test with unique
> TestID, and i also hold 
> the bookID (the book that the test refers to)
> 
> Question: the actual question, with QuestionID. i
> also store the TestID 
> that it refers to.
> 
> THe system will be holding info on 100s of books and
> tests. I have set it 
> up that the user can add info on each of them to the
> DB. But what they 
> have to do is to know the Test or Book ID when they
> enter the record...
> 
> eg. adding a test, they can input the test
> information but they have to 
> know the bookID before they enter it. This isnt the
> way i want to do 
> it....how can i get a better way of doing this?
> 
> ie. again if i go to enter a question it will ask
> them for the testID it 
> relates to.... which they must enter.
> 
> can anyone suggest anything?
> i hope yous understand what im trying to get at! :(
> 
> Thanx guys,


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Message #3 by "WVerner" <w_verner@h...> on Fri, 21 Mar 2003 18:27:09
thanx mark,
i was thinkin of doing that way. having a drop down box allowing them to 
select the book they want to attach the test to. How do i populate a list 
with all the books from the database?
Message #4 by Mark Eckeard <meckeard2000@y...> on Fri, 21 Mar 2003 10:21:37 -0800 (PST)
Write code that do something like this:

Select BookID, BookName
From Book

Next, loop through the recordset and display the data,
like this:

if not RS.EOF then
do until RS.EOF
response.write("<option value=" &
RS.Fields("BookID").value & ">" &
RS.Fields("BookName").value " & "</option>")
RS.Movenext
loop
end if

You should be able to search the internet for articles
on this subject.  

Mark.

--- WVerner <w_verner@h...> wrote:
> thanx mark,
> i was thinkin of doing that way. having a drop down
> box allowing them to 
> select the book they want to attach the test to. How
> do i populate a list 
> with all the books from the database?


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

  Return to Index