Hi, I am having major problems when the with a reletivly simple peice of code, I have two tables one for questions and another for the answers which will be multiple choice , therefore each question will have 2 or more answers, so to test this I am trying to print out the question with the relevant set of answers in a table. The problem I am having is testing the answer with the question, the relation is where they both have the same question ID.....
Here is the error message:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
I have tested different ways,the problem is in this line:
oRSQuestions("quest_id".value = oRSanswers("quest_id".value
Please can someone look at my code to see if they know where I am going wrong, i would really appreciate any suggestions.
<%
set oRSanswers = Server.CreateObject("ADODB.Recordset"
oRSanswers.ActiveConnection = "driver={SQL Server)**"
oRSanswers.CursorType = 1
oRSanswers.CursorLocation = 1
oRSanswers.LockType = 1
oRSanswers_numRows = 0
set oRSQuestions = Server.CreateObject("ADODB.Recordset"
oRSQuestions.ActiveConnection = "driver={SQL Server}**"
oRSQuestions.CursorType = 1
oRSQuestions.CursorLocation = 1
oRSQuestions.LockType = 1
oRSQuestions_numRows = 0
oRSQuestions.source = "SELECT question FROM QUESTIONS ORDER BY QUEST_ID"
oRSanswers.source = "SELECT answer FROM ANSWERS ORDER BY QUEST_ID"
oRSQuestions.Open
oRSanswers.Open
do while not oRSQuestions.EOF
response.write"<tr>"
response.write"<td>"& oRSQuestions("question" &"</td>"
do while NOT oRSanswers.EOF AND oRSQuestions("quest_id".value = oRSanswers("quest_id".value
response.write"<td>"& oRSanswers("answer"&"</td>"
oRSanswers.movenext
loop
response.write"</TR>"
oRSQuestions.movenext
loop
oRSanswers.close
oRSQuestions.close
set oRSanswers = nothing
set oRSQuestions = nothing
%>
Here is the error message:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
I have tested different ways,the problem is in this line:
oRSQuestions("quest_id".value = oRSanswers("quest_id".value
Please can someone look at my code to see if they know where I am going wrong, i would really appreciate any suggestions.
<%
set oRSanswers = Server.CreateObject("ADODB.Recordset"
oRSanswers.ActiveConnection = "driver={SQL Server)**"
oRSanswers.CursorType = 1
oRSanswers.CursorLocation = 1
oRSanswers.LockType = 1
oRSanswers_numRows = 0
set oRSQuestions = Server.CreateObject("ADODB.Recordset"
oRSQuestions.ActiveConnection = "driver={SQL Server}**"
oRSQuestions.CursorType = 1
oRSQuestions.CursorLocation = 1
oRSQuestions.LockType = 1
oRSQuestions_numRows = 0
oRSQuestions.source = "SELECT question FROM QUESTIONS ORDER BY QUEST_ID"
oRSanswers.source = "SELECT answer FROM ANSWERS ORDER BY QUEST_ID"
oRSQuestions.Open
oRSanswers.Open
do while not oRSQuestions.EOF
response.write"<tr>"
response.write"<td>"& oRSQuestions("question" &"</td>"
do while NOT oRSanswers.EOF AND oRSQuestions("quest_id".value = oRSanswers("quest_id".value
response.write"<td>"& oRSanswers("answer"&"</td>"
oRSanswers.movenext
loop
response.write"</TR>"
oRSQuestions.movenext
loop
oRSanswers.close
oRSQuestions.close
set oRSanswers = nothing
set oRSQuestions = nothing
%>