我如果想在一个循环中访问两个数据库表怎么办?(asp)
Functiondk_products_category() Setrs=server.CreateObject("adodb.reco...
Function dk_products_category() Set rs = server.CreateObject("adodb.recordset") sql = "select * from dk_products_category where dk_products_category_parent = 0 order by dk_products_category_order asc" rs.Open sql, conn, 1, 1 Do While Not rs.EOF dk_products_category = dk_products_category&("<dt><a href='products_category.asp?id="&rs("ID")&"'>"&rs("dk_products_category_name")&"</a></dt>") Set rss = server.CreateObject("adodb.recordset") sql = "select * from dk_products where dk_products_category = "&rs("ID") rss.Open sql, conn, 1, 1 Do While Not rss.EOF dk_products_category = dk_products_category&("<dd><a href='products_category.asp?id="&rss("id")&"'>"&rss("dk_products_category_name")&"</a></dd>") rss.movenext Loop set rss=nothing rs.movenext LoopEnd Function 这个是出错后的页面
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询