can't display records from Access Table.
I have a table in MS Access shown below. I am able to display the score for quiz_id=1. However, it will not display scores when I attempt to write sql statements (shown below) for 2, 3, and 4. Please advise..
MS ACCESS TABLE:
StudentTable
StudentID quiz_id Score
123456789 1 100
123456789 2 75
123456789 3 45
123456789 4 75
<%
sqltext1 = "SELECT * FROM StudentTable WHERE StudentID='" & Session("username") & "'"
oRS.Open sqltext1, oConn
IF oRS("quiz_id") = "1" Then
Response.Write "" & oRS("Score") & "%" & ""
Else
Response.Write "0"
End If
oRs.Close
%>
</td>
<td width="125" align="center">
<%
sqltext2 = "SELECT * FROM StudentTable WHERE StudentID='" & Session("username") & "'"
oRS.Open sqltext1, oConn
IF oRS("quiz_id") = "2" Then
Response.Write "" & oRS("Score") & "%" & ""
Else
Response.Write "0"
End If
oRs.Close
%>
Repeat for 3 and 4.
The only score that displays is when quiz_id = 1
|