[WEB4LIB] VBscript, ASP and Access
Bouchard, Kerry
k.bouchard at tcu.edu
Tue Jun 6 17:56:50 EDT 2000
I think you just need to create an empty variable (e.g.,
"LastGroup") before you enter the loop, and then compare
objRS("GroupCategory") to the variable on each repetition of the loop, e.g.:
<%
LastGroup = ""
Do While Not objRS.EOF
If objRS("GroupCategory") <> LastGroup then
Response.Write "<font size=2>" & objRS ("GroupCategory") & "</font><br>"
LastGroup = objRS("GroupCategory")
End If
Response.Write "<li>" & objRS ("Link") & "<br>"
Response.Write "--" & objRS ("Notes")& "</p>"
objRS.MoveNext
Loop
%>
Kerry Bouchard
Asst. University Librarian for Automated Systems
Mary Couts Burnett Library, TCU
-----Original Message-----
From: Joyce Wong [mailto:jowong at langara.bc.ca]
Sent: Tuesday, June 06, 2000 3:27 PM
To: Multiple recipients of list
Subject: [WEB4LIB] VBscript, ASP and Access
Hello,
I am not sure if this is the right forum for this question but any
assistance on it would be much appreciated. I am attempting to output
values from a field as group headers using Microsoft Acess Database and ASP
with VBScript.
For example:
Original Table
ABI Inform Article Database
CIA Area Studies Country Studies
EBSCO Article Database
UNESCO Country Studies
Final Output
Article Database
ABI Inform
EBSCO
Country Studies
CIA Area Studies
UNESCO
The loop I am using is below but I would like to output GroupCategory as a
group header for a series of records rather than have it repeated through
each record:
<%
Do While Not objRS.EOF
Response.Write "<li>" & objRS ("Link") & "<br>"
Response.Write "<font size=2>" & objRS ("GroupCategory") &
"</font><br>"
Response.Write "--" & objRS ("Notes")& "</p>"
objRS.MoveNext
Loop
%>
Has anyone done this before and can advise me on how I should proceed?
Thank you in advance
Joyce Wong
Joyce Wong
Reference Librarian / Library Web Development
100 West 49th Ave., Vancouver, B.C. V5Y 2Z6
Tel: 604-323-5432 Fax: 604-323-5555
Email: jowong at langara.bc.ca
More information about the Web4lib
mailing list