日期:2014-05-16  浏览次数:21108 次

asp查询数据的时候发现错误,请检查您的查询代码是否正确。
左侧分类栏
<%
set rs=oa.execute("select * from classlist where classid=467 or parentid=467")
if not rs.eof and not rs.bof then
do while not rs.eof
%>
          <a href="product.asp?pid=<%=rs("classid")%>"><%=rs("classname")%></a>
<%
  rs.movenext
  loop
  else
%>
            <font  color="#FF0000" style='font-size:12px'>暂未添加内容!!</font>
<%
end if 
rs.close
%>   



右侧列表栏

        
<%
proid=request.QueryString("pid")
if proid<>""then
set rs=oa.execute("select * from c_Article where classid= "&proid&"")
if not rs.eof and not rs.bof then
do while not rs.eof
%>
   
   
 <li><a href="#"><img src="<% if rs("defaultpicurl")="" then%>img/nopic.jpg<%else%><%=rs("defaultpicurl")%><%end if%>" width="147" height="128" /></a> <a style="padding-top:8px;" href="#"><%if len(rs("title"))<12 then%><%=rs("title")%><%else%><%=left(rs("title"),12)&".."%><%end if%></a></li>
            
            
            
<%
  rs.movenext
  loop
  else
%>
            <font  color="#FF0000" style='font-size:12px'>暂未添加内容!!</font>
<%
end if 
rs.close
%>
<%else%>
没有产品
<%end if%>   

找了一个小时没有找到问题在哪,初学者求指教         

------解决方案--------------------
加了容错处理了吧,找到on error resume next的语句,注释掉,看具体错误