第一次来发帖求助哦,运行时错误 错误 '800a000d'

时间:2022-06-10 14:12:11
错误页面时这个http://www.minsda.com/view.asp?id=20 是新闻浏览内容页面,报错代码是

Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配

/view.asp,行 124

这个页面我自己修改了,因为我没有学过asp,我简单修改了下,目的是因为每个页面的标题多是公司名称,我想以文章标题+公司名称作为标题 就找到的文章的title字段  <%=rs("title")%> 放在公司名称字段 <%=SiteTitle%>的前面 并把文章内容显示前面的数据查找的sql语句放在页面头部
<%
dim rs,sql,id
id=Request("id")
if id ="" or id=empty then 
Response.Redirect("news.asp")
Response.End()
else
id=cint(Request("id"))
end if

sql="select * from news where newsid="&id&""
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("news.asp")
Response.End()
end if
%>

在线求教哦,我第一次来提问,拜托各位了

5 个解决方案

#1




以下是不会报错的,写这个程序的程序员写的源文件
<!--#include file="include.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=SiteTitle%></title>
<meta name="keywords" content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="head.asp"--></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td><%
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
%></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="209" valign="top" class="bg"><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td height="29" background="pic/lbg.gif" class="font2">&nbsp;&nbsp;新闻动态</td>
              </tr>
  <tr>
                <td height="10"></td>
              </tr>
              <tr>
                <td><table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <%
set rs_child=server.CreateObject("adodb.recordset")
sql ="select * from Newsclass where parentid=0 order by classid"
rs_child.open sql,conn,3
if rs_child.eof  then
%>
                  <tr>
                    <td height="23" colspan="3">   对不起该分类没有子分类!!!!</td>
                  </tr>
                  <%
else
for j=1 to cint(rs_child.recordcount)
%>
                  <tr>
                    <td height="30"><img src="images/tian.jpg" />&nbsp;&nbsp;&nbsp;<a href="news.asp?id=<%=rs_child("classid")%>" target="_self"><strong><%=rs_child("classname")%></strong></a></td>
                  </tr>
                  <tr>
                    <td height="1" background="images/d.jpg"></td>
                  </tr>
                  <%
rs_child.movenext
next
end if
rs_child.close
set rs_child=nothing
%>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><!--#include file="left.asp"--></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c2.jpg" width="14" height="410" /></td>
        <td valign="top" class="bg1"><table width="714" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td background="pic/bg.jpg" height="31" class="font2">&nbsp;&nbsp;&nbsp;&nbsp;公司新闻 | News</td>
          </tr>
          <tr>
            <td height="1" background="images/hen.jpg"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td class="font1"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><%
dim rs,sql,id
id=Request("id")
if id ="" or id=empty then 
Response.Redirect("news.asp")
Response.End()
else
id=cint(Request("id"))
end if

sql="select * from news where newsid="&id&""
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("news.asp")
Response.End()
end if
%>
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td height="50" ><div align="center"><b><%=rs("title")%></b></div></td>
                                </tr>
                                <tr>
                                  <td height="1"background="img/line.gif"></td>
                                </tr>
                                <tr>
                                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td valign="middle" class="wenzi"><%=rs("content")%></td>
                                      </tr>
                                  </table></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td height="1"background="img/line.gif"></td>
                          </tr>
                          <tr>
                            <td height="15"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#EBECEE"><div align="center">
                              <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="49%" height="30"><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid<"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("上一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("上一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                  <td width="2%">&nbsp;</td>
                                  <td><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid>"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("下一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("下一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                </tr>
                              </table>
                            </div></td>
                          </tr>
                      </table></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c5.jpg" width="14" height="410" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><!--#include file="foot.asp"--></td>
  </tr>
</table>
</body>
</html>

#2


这个是我修改后的源文件是
<!--#include file="include.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
dim rs,sql,id
id=Request("id")
if id ="" or id=empty then 
Response.Redirect("news.asp")
Response.End()
else
id=cint(Request("id"))
end if

sql="select * from news where newsid="&id&""
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("news.asp")
Response.End()
end if
%>

<title><%=rs("title")%>_<%=SiteTitle%></title>
<meta name="keywords" content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="head.asp"--></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td><%
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
%></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="209" valign="top" class="bg"><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td height="29" background="pic/lbg.gif" class="font2">&nbsp;&nbsp;新闻动态</td>
              </tr>
  <tr>
                <td height="10"></td>
              </tr>
              <tr>
                <td><table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <%
set rs_child=server.CreateObject("adodb.recordset")
sql ="select * from Newsclass where parentid=0 order by classid"
rs_child.open sql,conn,3
if rs_child.eof  then
%>
                  <tr>
                    <td height="23" colspan="3">   对不起该分类没有子分类!!!!</td>
                  </tr>
                  <%
else
for j=1 to cint(rs_child.recordcount)
%>
                  <tr>
                    <td height="30"><img src="images/tian.jpg" />&nbsp;&nbsp;&nbsp;<a href="news.asp?id=<%=rs_child("classid")%>" target="_self"><strong><%=rs_child("classname")%></strong></a></td>
                  </tr>
                  <tr>
                    <td height="1" background="images/d.jpg"></td>
                  </tr>
                  <%
rs_child.movenext
next
end if
rs_child.close
set rs_child=nothing
%>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><!--#include file="left.asp"--></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c2.jpg" width="14" height="410" /></td>
        <td valign="top" class="bg1"><table width="714" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td background="pic/bg.jpg" height="31" class="font2">&nbsp;&nbsp;&nbsp;&nbsp;公司新闻 | News</td>
          </tr>
          <tr>
            <td height="1" background="images/hen.jpg"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td class="font1"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td height="50" ><div align="center"><b><%=rs("title")%></b></div></td>
                                </tr>
                                <tr>
                                  <td height="1"background="img/line.gif"></td>
                                </tr>
                                <tr>
                                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td valign="middle" class="wenzi"><%=rs("content")%></td>
                                      </tr>
                                  </table></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td height="1"background="img/line.gif"></td>
                          </tr>
                          <tr>
                            <td height="15"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#EBECEE"><div align="center">
                              <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="49%" height="30"><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid<"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("上一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("上一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                  <td width="2%">&nbsp;</td>
                                  <td><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid>"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("下一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("下一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                </tr>
                              </table>
                            </div></td>
                          </tr>
                      </table></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c5.jpg" width="14" height="410" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><!--#include file="foot.asp"--></td>
  </tr>
</table>
</body>
</html>

#3


你把那个新闻的rs放到头部后,后面有建了另一个图片的rs,然后把它close掉了(第45行)
,所以你后面第124行<%=rs("title")%> 这里的rs就是空引用了。
解决方法是把图片的rs另取一个名字

#4


引用 3 楼 oldhen123 的回复:
你把那个新闻的rs放到头部后,后面有建了另一个图片的rs,然后把它close掉了(第45行)
,所以你后面第124行<%=rs("title")%> 这里的rs就是空引用了。
解决方法是把图片的rs另取一个名字

还是不会哦  我懂asp

#5


把这段代码
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
里面的rs全换成rs2或者其它都行

#1




以下是不会报错的,写这个程序的程序员写的源文件
<!--#include file="include.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=SiteTitle%></title>
<meta name="keywords" content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="head.asp"--></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td><%
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
%></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="209" valign="top" class="bg"><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td height="29" background="pic/lbg.gif" class="font2">&nbsp;&nbsp;新闻动态</td>
              </tr>
  <tr>
                <td height="10"></td>
              </tr>
              <tr>
                <td><table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <%
set rs_child=server.CreateObject("adodb.recordset")
sql ="select * from Newsclass where parentid=0 order by classid"
rs_child.open sql,conn,3
if rs_child.eof  then
%>
                  <tr>
                    <td height="23" colspan="3">   对不起该分类没有子分类!!!!</td>
                  </tr>
                  <%
else
for j=1 to cint(rs_child.recordcount)
%>
                  <tr>
                    <td height="30"><img src="images/tian.jpg" />&nbsp;&nbsp;&nbsp;<a href="news.asp?id=<%=rs_child("classid")%>" target="_self"><strong><%=rs_child("classname")%></strong></a></td>
                  </tr>
                  <tr>
                    <td height="1" background="images/d.jpg"></td>
                  </tr>
                  <%
rs_child.movenext
next
end if
rs_child.close
set rs_child=nothing
%>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><!--#include file="left.asp"--></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c2.jpg" width="14" height="410" /></td>
        <td valign="top" class="bg1"><table width="714" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td background="pic/bg.jpg" height="31" class="font2">&nbsp;&nbsp;&nbsp;&nbsp;公司新闻 | News</td>
          </tr>
          <tr>
            <td height="1" background="images/hen.jpg"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td class="font1"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><%
dim rs,sql,id
id=Request("id")
if id ="" or id=empty then 
Response.Redirect("news.asp")
Response.End()
else
id=cint(Request("id"))
end if

sql="select * from news where newsid="&id&""
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("news.asp")
Response.End()
end if
%>
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td height="50" ><div align="center"><b><%=rs("title")%></b></div></td>
                                </tr>
                                <tr>
                                  <td height="1"background="img/line.gif"></td>
                                </tr>
                                <tr>
                                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td valign="middle" class="wenzi"><%=rs("content")%></td>
                                      </tr>
                                  </table></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td height="1"background="img/line.gif"></td>
                          </tr>
                          <tr>
                            <td height="15"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#EBECEE"><div align="center">
                              <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="49%" height="30"><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid<"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("上一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("上一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                  <td width="2%">&nbsp;</td>
                                  <td><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid>"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("下一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("下一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                </tr>
                              </table>
                            </div></td>
                          </tr>
                      </table></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c5.jpg" width="14" height="410" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><!--#include file="foot.asp"--></td>
  </tr>
</table>
</body>
</html>

#2


这个是我修改后的源文件是
<!--#include file="include.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
dim rs,sql,id
id=Request("id")
if id ="" or id=empty then 
Response.Redirect("news.asp")
Response.End()
else
id=cint(Request("id"))
end if

sql="select * from news where newsid="&id&""
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("news.asp")
Response.End()
end if
%>

<title><%=rs("title")%>_<%=SiteTitle%></title>
<meta name="keywords" content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="head.asp"--></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td><%
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
%></td>
  </tr>
  <tr>
    <td height="1"></td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="209" valign="top" class="bg"><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td height="29" background="pic/lbg.gif" class="font2">&nbsp;&nbsp;新闻动态</td>
              </tr>
  <tr>
                <td height="10"></td>
              </tr>
              <tr>
                <td><table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
                  <%
set rs_child=server.CreateObject("adodb.recordset")
sql ="select * from Newsclass where parentid=0 order by classid"
rs_child.open sql,conn,3
if rs_child.eof  then
%>
                  <tr>
                    <td height="23" colspan="3">   对不起该分类没有子分类!!!!</td>
                  </tr>
                  <%
else
for j=1 to cint(rs_child.recordcount)
%>
                  <tr>
                    <td height="30"><img src="images/tian.jpg" />&nbsp;&nbsp;&nbsp;<a href="news.asp?id=<%=rs_child("classid")%>" target="_self"><strong><%=rs_child("classname")%></strong></a></td>
                  </tr>
                  <tr>
                    <td height="1" background="images/d.jpg"></td>
                  </tr>
                  <%
rs_child.movenext
next
end if
rs_child.close
set rs_child=nothing
%>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><!--#include file="left.asp"--></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c2.jpg" width="14" height="410" /></td>
        <td valign="top" class="bg1"><table width="714" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td background="pic/bg.jpg" height="31" class="font2">&nbsp;&nbsp;&nbsp;&nbsp;公司新闻 | News</td>
          </tr>
          <tr>
            <td height="1" background="images/hen.jpg"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td class="font1"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td><table width="100%"  border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td height="50" ><div align="center"><b><%=rs("title")%></b></div></td>
                                </tr>
                                <tr>
                                  <td height="1"background="img/line.gif"></td>
                                </tr>
                                <tr>
                                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td valign="middle" class="wenzi"><%=rs("content")%></td>
                                      </tr>
                                  </table></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td height="7"><div align="center"></div></td>
                          </tr>
                          <tr>
                            <td height="1"background="img/line.gif"></td>
                          </tr>
                          <tr>
                            <td height="15"></td>
                          </tr>
                          <tr>
                            <td bgcolor="#EBECEE"><div align="center">
                              <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="49%" height="30"><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid<"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("上一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("上一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                  <td width="2%">&nbsp;</td>
                                  <td><%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 1 * from news where newsid>"&request("id")&" order by newsid desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("下一篇新闻:已经没有了")
else
sid=rs("newsid")
spname=rs("title")
Response.Write("下一篇新闻:<a href='view.asp?id="&sid&"'>"&spname&"</a>")
end if
rs.close
Set rs = Nothing
%>
                                  </td>
                                </tr>
                              </table>
                            </div></td>
                          </tr>
                      </table></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="14" valign="top"><img src="images/b_r1_c5.jpg" width="14" height="410" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><!--#include file="foot.asp"--></td>
  </tr>
</table>
</body>
</html>

#3


你把那个新闻的rs放到头部后,后面有建了另一个图片的rs,然后把它close掉了(第45行)
,所以你后面第124行<%=rs("title")%> 这里的rs就是空引用了。
解决方法是把图片的rs另取一个名字

#4


引用 3 楼 oldhen123 的回复:
你把那个新闻的rs放到头部后,后面有建了另一个图片的rs,然后把它close掉了(第45行)
,所以你后面第124行<%=rs("title")%> 这里的rs就是空引用了。
解决方法是把图片的rs另取一个名字

还是不会哦  我懂asp

#5


把这段代码
sql="select * from Images where ID=3"
set rs=execute(sql)
if rs.eof and rs.bof then
Response.Redirect("/")
Response.End()
end if
Response.Write ("<img src='"&mid(rs("pic"),2)&"' border='0' width='990'/>")
rs.close  
set rs=nothing
里面的rs全换成rs2或者其它都行