ADO TutorialLesson 64Free preview
ADO Display
This lesson is part of ASP · All levels
Summary
Displaying Recordset data is usually done by building an HTML table within a loop, so that each row of the database becomes one row of the table. Use the Do While Not construct and then slide with MoveNext to stop the loop correctly. User-generated content should be encoded first so as not to damage the HTML structure.
Key points
- Loop Do While Not is a standard reading pattern.
- Each record is rendered to <tr> with <td> cells.
- Use HTMLEncode for data that contains malicious HTML characters.
- Close the recordset and the connection after the table is finished.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.