asp 数据库访问不正确
代码如下:
<%
sub writemenu()
Set rs2=Server.CreateObject("ADODB.RecordSet")
Set rs1=Server.CreateObject("ADODB.RecordSet")
sql2="select * from class1 order by paixu"
rs2.open sql2,con,3,3
do while not (rs2.eof or err)
sql1="select * from class where dalei="&rs2("name")
rs1.open sql1,con,3,3
do while not (rs1.eof or err)
%>
<a href="webshow.asp?Sort_id=<%=rs1("sort_id")%>"><%=rs1("sort")%></a>
<%
rs1.moveNext
loop
rs1.close
rs2.moveNext
loop
rs2.close
end sub
%>
请高手帮忙啊
參考答案:定义了 conn 么 ...?
要把 conn 文件 include 进来 ..?
==========================================================
do while not (rs2.eof or err)
sql1="select * from class where dalei='"&rs2("name")&"'"
rs1.open sql1,con,3,3
这样试试看 ..?