Dealing with multiple records

Results 1 to 2 of 2

Thread: Dealing with multiple records

  1. #1
    stuvi Guest

    Default Dealing with multiple records

    I am trying to find a way to display records taken from an access database on a web page. I am using asp and vbscript.<BR>My problem is that i am trying to get records from two tables, &#039;Session&#039; and &#039;Target&#039;. the relationship is a session can have many targets. <BR>I load the records into a recordset using asp and vbscript, but when displaying the records, it writes a new row for every session which has multiple targets. (ie, all duplicate data (name, ect) except target).<BR>Is there a way to put all the multiple target data for each session in one row with the session records.<BR><BR>I hope this makes sense. Most likely not, but if someone does understand and has a solution, please let me know.

  2. #2
    Eddie Campbell Guest

    Default RE: Dealing with multiple records

    If you only need to display 1 session at a time, you could create 2 recordsets. 1 containing the session details and the other the Target ones. Then display the Session details on the form and put the Target details in a Listbox.<BR><BR>I you need to display multiple Sessions of screen, do something like this.<BR><BR>&#060;% Get Recordset<BR> LastSessionId = ""<BR> Do While Not(rs.Eof)<BR> If rs("SessionId") = LastSessionId Then<BR>&#039; This is a new Session record so display the session details for this row only<BR> LastSessionId = rs("SessionID")<BR> End If<BR>&#039; Now show the Target details for each row in the recordset<BR> rs.MoveNext<BR> Loop<BR>%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts