Hi All
I have threee tables like the one below and i would like to ask if it is
possible to display the data from all three tables using a single recordset
in ASP.
TABLE - tblList
id - Number
ListName - Text
TABLE - tblListMembers
ListId - Number
Username - Text
TABLE - tblEmployees
UserName - Text
FirstName - Text
LastName - Text
Email - Text
This is to store data like Distribution lists in outlook.
What I want to display on one page is to display all the list and the name
of the members? but the poor code opens two records sets and is very slow
This is what I am doing at the moment. (not exact code but just a general
idea)
SQL = "Select Id, Listname from tblListMembers"
RS.Open SQL,conn
Do while not rs.eof
Response.write "Listname" & "<br>"
stSQL = "Select * from tblListMembers where listid = " & rs("id")
rs1.open stSQL, conn
Do while not RS1.eof
Response.write "- --- -- " & rs("username") & "<br>"
rs1.movenext
loop
rs1.close
rs.movenext
loop
I am certain opening a record set within a loop continuously is a bad
practice. Can someone please let me know how can I get this information in
single recordset and how can I display that.
Many thanks
Jas