114
|
Chapter 6
Using Reports to Query and Update Data Sources
This is a good start, but not quite what we want. To cycle through the
records, we’ll need to add some sort of looping code. That’s what the two
scripts are for.
The beginning script contains a single line, which operates on the
RS
object.
RS.EOF
represents
RS
object’s end-of-file property. In effect, the line is saying
do the following until you reach the end:
Do While Not RS.EOF
The ending block contains two lines, one that advances to the next record in
the recordset and another that finishes up the loop structure:
RS.MoveNext
Loop
Now we’re ready to load the page in our browser.
Seeing the Results
Here’s a listing of the complete ASP file
parcel_report.asp
:
<HTML>
<HEAD>
<!-- code to create recordset -->
<%
Set dbConnection = Server.CreateObject("ADODB.Connection")
dbConnection.Open ("Assessor")
SQLQuery = "SELECT * FROM Parcel_Data Where YearBlt = '1963'"
Set RS = dbConnection.Execute(SQLQuery)
%>
<TITLE>ASP Test #1</TITLE>
</HEAD>
<BODY>
<H1>ASP Test #1</H1>
<!-- output code -->
<%
Do While Not RS.EOF
%>
<P>Parcel Number: <%=RS("APN")%><BR>
Owner: <%=RS("Owner")%><BR>
Year Built: <%=RS("yearblt")%></P>
<%
RS.MoveNext
Loop
%>
</BODY>
</HTML>
Summary of Contents for 15606-011408-9300 - MAP R6.3 UPG
Page 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Page 6: ...vi ...
Page 16: ...16 ...
Page 30: ...30 ...
Page 84: ...84 ...
Page 134: ...134 ...
Page 202: ...202 ...