Databases Reference
In-Depth Information
connective = " AND "
End If
Next we open the recordset:
' Open recordset
rs.Open sSQL, cn
Now we can write the search results to HTML output, using the
Write
method of the
ASP
Response
object (the HTML header has already been written):
' Write search results to html output
' First write search form's control values for reference
connective = ""
Response.Write "<font color='Green'>Search Criteria</font><br>"
If title <> "" Then
Response.Write connective & "<font color='Blue'>Title</font>:" &
title
connective = "; "
end if
If author <> "" Then
Response.Write connective & "<font color='Blue'>Author</font>:" &
author
connective = "; "
End If
If publisher <> "" Then
Response.Write connective & "<font color='Blue'>Pub</font>:" &
publisher
End If
Response.Write "<br>"
connective = ""
' Loop through recordset
cMatches = 0
Do While Not rs.eof
cMatches = cMatches + 1
Response.Write "<HR><font color='Green'>" & cMatches & " - " &
rs("Title") & "</font>"
Response.Write "<br>" & rs("Au")
' Collect bibliographic data from recordset
bib = ""
if rs("Date") <> "" then bib = bib & ", " & rs("Date")
if rs("ISBN") <> "" then bib = bib & ", " & rs("ISBN")
if rs("Pages") <> "" then bib = bib & ", " & rs("Pages") & " pp."
if rs("Price") <> "" then bib = bib & ", $" & rs("Price")
' Remove leading comma and space and print it
bib = "<br>" & mid(bib, 2)
Response.write bib
' Write TOC