set rs=Server.CreateObject("adodb.recordset") sqlstr="select*from 表" rs.open sqlstr,conn,1,3 while not rs.eof 表ID=rs("表ID") set rs2=Server.CreateObject("adodb.recordset") sqlstr="select*from 表2 where 表ID=表ID rs2.open sqlstr,conn,1,3 while not rs2.eof 表2ID=rs("表2ID") set rs3=server.CreateObject("adodb.recordset") sqlstr="select*from 表3 where 表2ID=表2ID while not rs3.eof rs3.movenext wend rs3.close set rs3=nothing rs2.movenext wend rs2.close set rs2=nothing rs.movenext wend rs.close set rs=nothing conn.close set conn=nothing
三表循环嵌套查询
最新推荐文章于 2020-10-06 09:27:30 发布