ASP二级显示的问题?

来源:百度知道 编辑:UC知道 时间:2024/05/25 07:00:54
现在是这么一个问题,我想要用点击列表菜单里面的项后显示里面所属的新闻,可是为什么做不到呢,老是提示对象关闭不能操作啊。

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="config/conn.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>查看新闻</title>
</head>

<body>
<table width="190" border="0" cellspacing="0" cellpadding="0">
<tr>
<%dim rs
set rs=server.CreateObject("a

<%dim rs1
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from news where 1class='"&rs("1class")&"'"
rs1.open sql1,conn,1,1
if not rs1.eof then
%>
<td><%=rs1("title")%></td>
</tr>
<tr>
<td><%=rs1("neir")%></td>
</tr><%
end if
%>

是这样

你的news表中1class字段是什么类型的,如果是数字类型,这样写就不对,应该写成
<%dim rs1
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from news where 1class="&rs("1class")&""
rs1.open sql1,conn,1,1
if not rs1.eof then
%>