access双表筛选查询问题
各位大哥帮帮小弟,感激不尽!
classname:分类名,title:标题
access数据库表:1.kydwclass(id,classname),2.kydw(kydw_id, title,classname)
页面:
想先用循环以数据库内classname分别建表,表内容为筛选对应classname的title,这部分应该如何建立啊.
<%set rs = server.CreateObject("adodb.recordset")
sql="select * from [kydwclass] "
rs.open sql,conn,1,1
do while not rs.eof
%>
<table>
<tr>
<td>
<%=rs("classname")%>
</td>
</tr>
<table>
<tr>
<td>
<%
set rs1=server.CreateObject("adodb.recordset")
sql="select * from [kydw] where ?????????????
rs1.open sql,conn,1,1
do while not rs1.eof
%>
<%=rs1("title")%>
<%
rs1.movenext
loop
rs1.close
%>
</td>
</tr>
</table>
</table>
<%
rs.movenext
loop
rs.close
%>