splitting a recordset

Results 1 to 2 of 2

Thread: splitting a recordset

  1. #1
    Join Date
    Dec 1969

    Default splitting a recordset

    I have a recordset wich contains about 50 film titles in an alphabetical order. I want to display these titles in a two-collumn table. So what I need to do is to iterate through the first half of the recordset and write the titles in the first collumn, and then move to the next collumn where I will iterate through the rest and write them...<BR><BR>The only problem is I don&#039;t know how to do it... One way to do it would be to get the number of titles in the recordset, divide that on two (and make the answer an integer if needed) and then use two for loops. However, I suspect that this is not the best way and besides, I don&#039;t know how to transfer my idea into code..:(<BR><BR>Can anyone help me with this one?

  2. #2
    Ghose Guest

    Default RE: splitting a recordset

    If you don&#039;t have to have them directly beneath each other then you can try this. This will write 2 cells then a new row...<BR><BR>response.write("&#060;table&#062;&#0 60;tr&#062;")<BR>i = 0<BR>do while not rs.EOF<BR> if i &#062; 1 then<BR> response.write("&#060;/tr&#062;&#060;tr&#062;")<BR> i = 0<BR> end if<BR> response.write("&#060;td&#062;" & rs(0) & "&#060;/td&#062;")<BR> i = i + 1<BR> rs.MoveNext<BR>loop<BR>response.write("&#060;/tr&#062;&#060;/table&#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