Hello guys, i got the following code:
Code ASP:
sql1= "SELECT * FROM Animals WHERE (adoptionstatus= 'זמין')  AND (animaltype= 'חתול') ORDER BY FileID DESC"
RS.Open sql1, conn, 3, 3
If Not RS.EOF then
 Do While Not RS.EOF
  sName = RS("PetName")
  sDesc = RS("Desc")
  sDesc = RS(sDesc, vbNewLine, "<br/>")
  Response.Write "<tr>"
  ' Code that displays Pet's infos
  iPetID = RS("FileID")
  sql2 = "SELECT * FROM pictures WHERE FileID=" & iPetID
  RS2.Open sql2, conn, 3, 3
  Response.Write "<td width=260>"
  Do While Not RS2.EOF
   sImage = RS2("FileID")
   ' Code that displays Pets images
    RS2.MoveNext
  Loop
  Response.Write "</td>"
  RS2.close
  RS.MoveNext
 Response.Write "</tr>"
 Loop
RS.close

I want to know if its possible to change this code to a shorter code, using just a single recordset instead of 2, if yes can anybody show me a way how to do it?

Thanks,
Ulthane