ASP Tutorials

Display Records

display_records.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file = "data_source.inc" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Display my Quotes</title>
<style type="text/css">
<!--
body {background: #fff;}
#container {margin: auto; width:700px;}
.quote {background: #F0F0E1; padding: 1em; font: 19px Georgia, "Times New Roman", Times, serif;}
.author {text-align: right; margin-bottom: 2em; font: 10px Verdana, Geneva, sans-serif;}
-->
</style>
</head>

<body>
<div id="container">
<%
Dim my_connection, my_query, my_recordset

my_query = "SELECT * FROM my_quotes"
set my_connection = server.createObject("ADODB.Connection")
set my_recordset = server.createObject("ADODB.Recordset")

my_connection.open(my_database_source)
my_recordset.open my_query, my_connection
%>

<%
do while not my_recordset.eof

response.write "<div class='quote'>" & my_recordset("quote") & "</div>" & _
"<div class='author'>" & my_recordset("first_name") & _
my_recordset("last_name") & "</div>"

my_recordset.moveNext
loop
%>

<%
my_recordset.close
set my_recordset=nothing

my_connection.close
set my_connection=nothing
%>
</div>
</body>

Display records
I am beginning to suspect all elaborate and special systems of education. They seem to me to be built up on the supposition that every child is a kind of idiot who must be taught to think.
Anne Sullivan
Creativity is a type of learning process where the teacher and pupil are located in the same individual.
Arthur Koestler
Education is a better safeguard of liberty than a standing army.
Edward Everett
ASP Tutorials
Other Tutorials