Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Displaying Fields


Message #1 by "Mitten" <mittenshah@h...> on Wed, 22 Aug 2001 00:21:18
I'm trying to display data that will be in a following format:

Author : steeve,shawn,Peter

Title: Sports

Year: 2001



But instead of this im getting something like this:

Author: Steeve

Title: Sports

Year: 2001



Author: Shawn

Title: Sports

Year: 2001



Author: Peter

Title: Sports

Year: 2001



How can i stop this repeating? 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 =_

    objComm.CreateParameter("Required Journal",adVarChar,adParamInput,50)

    objComm.Parameters.Append objParam

    

    strJournal = Request.Form("Journal")

    objComm.Parameters("Required Journal") = strJournal

        

    Set objRS = objComm.Execute





  Set objComm1 = Server.CreateObject("ADODB.Command")

	objComm1.ActiveConnection = strConnect

   objComm1.CommandText = "searchingAuthors"

   objComm1.CommandType = adCmdStoredProc

    

   Set objParam1 =_

   objComm1.CreateParameter("Required Auth",adVarChar,adParamInput,50)

   objComm1.Parameters.Append objParam1

   

       

   strJournal1 = Request.Form("Journal")

   objComm1.Parameters("Required Auth") = strJournal1

   

	     

   Set objRS1 = objComm1.Execute





  Response.Write "<H2>Journal Articles by " & strJournal & "<br>"

  While Not objRS.EOF             ' now loop through the records

    

 Select Case varDropBox 



    Case "normal"  

     

    Response.Write "Authors : "

     Response.Write objRS("FName") & "," & "  " &_

     objRS("LName") & "<br>"

     

      Response.Write "Title : "

      Response.Write objRS("Title") & "," & "  " & "<br>"

     

     Response.Write "Year : "

     Response.Write objRS("Year")& "<br>"

 

    End Select

         

      objRS.MoveNext

  Wend  

  

  objRS.Close

  Set objRS = Nothing

%>

  Return to Index