Thanks alot John, the code worked but there's one small problem, the output im getting is something like
Authors : Title : Year : Authors : Title : Year : Steeve, Summers
Title : Management, &
Year : 2001
But how can i make my display look like this:
Author: Steeve Summers, Tom Spencer
Here is my code:
Dim objRS, objRS1,objComm,objComm1, objParam,objParam1, strJournal,strJournal1,varDropBox
varDropBox = Request.Form("style")
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect
objComm.CommandText = "searchJournal"
objComm.CommandType = adCmdStoredProc
Set objParam =_
strJournal = Request.Form("Journal")
objComm.Parameters("Required Journal") = strJournal
Set objRS = objComm.Execute
'Response.Write "<h1>Journal Articles by " & strJournal & "<br>"
While Not objRS.EOF
Select Case varDropBox
Response.Write "Authors : "
if left(stmp, 10) = "Authors : " then
stmp = "Authors : "
stmp = stmp & objRS("FName") & "," & " " &_
Response.Write "Title : "
if sPrevTitle = objRS("Title") then
stmp = stmp & vbcrlf & "Title : "
stmp = stmp & objRS("Title") & "," & " " & "&<br>"
sPrevTitle = objRS("Title")
Response.Write "Year : "
if sPrevYear = objRS("Year") then
'you already have this year - dont reprint it
stmp = stmp & "Year : "
stmp = stmp & objRS("Year")& "<br>"
sPrevYear = objRS("Year")
>From: John Pirkey
>Reply-To: "Pro ASP HowTo"
>To: "Pro ASP HowTo"
>Subject: [proasp_howto] Re: Desperate Help Needed
>Date: Thu, 23 Aug 2001 12:22:27 -0700 (PDT)
>you'll have to do some checking on the other types and if they are the same, then
>dont print out the other sections. also, you'll have to build a string of the final
>output and then only send it when you are done looping. something like this maybe:
>i can't really test this from work now, but i hope this gives you an idea of what
>i'm talking about. i've done it using other similar data structures, with some
>tweaking it should do what you want. yuo'll probably end up with some other flags
>for new titles/authors/years combinations.