A
Andy
hI,
wOULD PLEASE HELP ME. I AM GETTIGN THE REQUEST OBJECT ERROS ASP 0105:
80004005 INDEX OUT OF RANGE ERROR. HERE IS THE SNIPPET OF CODE THAT I
AM USING. WHAT IS WRONG HERE? YOU CAN SEE WHAT I AM TRYING TO DO ADN
ERROR ON THIS LINK: http://www.walani.com/ProjectFiles/01_main.asp.
PLEASE HELP
<%
Dim iQuestions 'Holds the question
Dim nScore ' Holds the number of answer
'Set nScore to highest possible score
nScore = 3
iQuestions = 1
While Not objRS.EOF
'==================THIS IS WHERE THE ERROR IS
If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then
bRightWrong = 1
Else
bRightWrong = 0
'~~~~~Set minus by number For how much Is counted off For Each
question~~~~~~
nScore = nScore - 1
End If
'~~~~Save the answers and grade to each question~~~~~~
strSQL = "INSERT INTO tblStudentTests
(STUserID,STQID,STAnswer,STRightWrong) VALUES ('" &
Request.Cookies("LoginData")("Login") & "@" &
Request.Cookies("LoginData")("Pass") & "', " & objRS("QID") & ",'" &
Request.Form(objRS("QID")) & "','" & bRightWrong & "')"
objConn.Execute(strSQL)
'~~~~~Show Question with Student answer and Grade~~~~~~
Response.Write(iQuestions & ". " & objRS("QQuestion") & ":<BR>")
Response.Write("Your Answer: " & Request.Form(objRS("QID")) & "<BR>")
Response.Write("<B>" & bRightWrong & "</B><BR><BR>")
objRS.MoveNext
iQuestions = iQuestions + 1
wend
%>
ANDY
wOULD PLEASE HELP ME. I AM GETTIGN THE REQUEST OBJECT ERROS ASP 0105:
80004005 INDEX OUT OF RANGE ERROR. HERE IS THE SNIPPET OF CODE THAT I
AM USING. WHAT IS WRONG HERE? YOU CAN SEE WHAT I AM TRYING TO DO ADN
ERROR ON THIS LINK: http://www.walani.com/ProjectFiles/01_main.asp.
PLEASE HELP
<%
Dim iQuestions 'Holds the question
Dim nScore ' Holds the number of answer
'Set nScore to highest possible score
nScore = 3
iQuestions = 1
While Not objRS.EOF
'==================THIS IS WHERE THE ERROR IS
If Request.Form(objRS("QID")) = objRS("QCorrectAnswer") Then
bRightWrong = 1
Else
bRightWrong = 0
'~~~~~Set minus by number For how much Is counted off For Each
question~~~~~~
nScore = nScore - 1
End If
'~~~~Save the answers and grade to each question~~~~~~
strSQL = "INSERT INTO tblStudentTests
(STUserID,STQID,STAnswer,STRightWrong) VALUES ('" &
Request.Cookies("LoginData")("Login") & "@" &
Request.Cookies("LoginData")("Pass") & "', " & objRS("QID") & ",'" &
Request.Form(objRS("QID")) & "','" & bRightWrong & "')"
objConn.Execute(strSQL)
'~~~~~Show Question with Student answer and Grade~~~~~~
Response.Write(iQuestions & ". " & objRS("QQuestion") & ":<BR>")
Response.Write("Your Answer: " & Request.Form(objRS("QID")) & "<BR>")
Response.Write("<B>" & bRightWrong & "</B><BR><BR>")
objRS.MoveNext
iQuestions = iQuestions + 1
wend
%>
ANDY