asp简单问题:为什么response.write(rs1("kch"))下显示两遍

来源:百度知道 编辑:UC知道 时间:2024/05/30 11:19:15
<%
sub show(xqjc)
Set rs = conn.ExeCute("select szbj from student where userName='"&session("userName")&"' and userPass='"&session("userPass")&"'")
if not rs.eof then
Set rs2 = conn.ExeCute("select kch from course where ksbj='"&rs("szbj")&"'")
end if
if not rs2.eof then
do while not rs2.eof
if rs2("kch")<>"" then
Set rs1 = conn.ExeCute("Select symc,kch From kb where xqjc='"&xqjc&"'")
if not rs1.eof then
do while not rs1.eof
if rs2("kch") <> rs1("kch") then
'response.write(rs1("symc"))
response.write("rs1="&rs1("kch")&" ")
response.write("rs2="&rs2("kch")&" ")
end if
rs1.movenext
loop

<%
sub show(xqjc)
Set rs = conn.ExeCute("select szbj from student where userName='"&session("userName")&"' and userPass='"&session("userPass")&"'")
if not rs.eof then
Set rs2 = conn.ExeCute("select kch from course where ksbj='"&rs("szbj")&"'")
else '------------------修改处
if not rs2.eof then
do while not rs2.eof
if rs2("kch")<>"" then
Set rs1 = conn.ExeCute("Select symc,kch From kb where xqjc='"&xqjc&"'")
if not rs1.eof then
do while not rs1.eof
if rs2("kch") <> rs1("kch") then
'response.write(rs1("symc"))
response.write("rs1="&rs1("kch")&" ")
response.write("rs2="&rs2("kch")&" ")
end if
rs