title: Highlighting specific records in classic ASP
body: <p>In my <a href="http://cauverycars.com/yaseen/quizModule02_08.asp" rel="nofollow">quiz page</a>, I have ten questions. When the user goes through these questions, I store the IDs of wrong questions in a array. When the user clicks on the "show result" link, I'm going to display all 10 questions with their answers. I want to highlight wrongly answered question with bold letters.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>Dim DB_CONN_STRING
  DB_CONN_STRING = "DBQ=" &amp; Server.MapPath("quiz.mdb") &amp; ";"
  DB_CONN_STRING = DB_CONN_STRING &amp; "Driver={Microsoft Access Driver (*.mdb)};"
  DB_CONN_STRING = DB_CONN_STRING &amp; "DriverId=25;FIL=MS Access;"
  
  Const QUIZ_ID = 1
  
  Dim panswer 
  
  panswer=split((Request.QueryString("marked")),",")
  
  ''# collecting wrongly answered question id in panswer
  Dim cnnQuiz, rsQuiz, I
  Set cnnQuiz = Server.CreateObject("ADODB.Connection")
  cnnQuiz.Open DB_CONN_STRING
  Set rsQuiz = Server.CreateObject("ADODB.Recordset")
  rsQuiz.Open "SELECT * FROM questions WHERE quiz_id=" &amp; QUIZ_ID &amp; " ORDER BY question_number;", cnnQuiz, 3, 1
  Do While Not rsQuiz.EOF
      For  I = LBound(panswer) to UBound(panswer)
          if (CStr(rsQuiz.Fields("question_number").Value)) = CStr(panswer(i)) then
              ''# testing whether this question is wrongly answered and if its true then making bold letters.
              response.Write("&lt;b&gt;"&amp;(rsQuiz.Fields("question_number").Value)&amp;")&lt;/b&gt;") 
              response.Write("&lt;b&gt;"&amp;(rsQuiz.Fields("question_text").Value)&amp;"&lt;/b&gt;&lt;br&gt;")
              response.Write("&lt;b&gt;"&amp;(rsQuiz.Fields("correct_answer").Value)&amp;"&lt;/b&gt;&lt;br&gt;")
          end if
      Next 
      '' # else displaying all 10 questions
      response.Write((rsQuiz.Fields("question_number").Value)&amp;") ") 
      response.Write((rsQuiz.Fields("question_text").Value)&amp;"&lt;br&gt;")
      response.Write((rsQuiz.Fields("correct_answer").Value)&amp;"&lt;br&gt;")
      rsQuiz.MoveNext
  Loop
  rsQuiz.Close
  Set rsQuiz = Nothing
  cnnQuiz.Close
  Set cnnQuiz = Nothing
  </code></pre>
  
  <p>Problem: this code displays all 10 records, but only the first item in the array gets highlighted, and it repeats twice. This is an existing website and I have to keep to classic ASP.</p>