红色标注语句为74行
当rs.open sql出现如下错误信息:
ADODB.Recordset 错误 '800a0e7d'
连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/1111/index.asp, 行74
当rs.open sql,conn,1,1出现如下错误信息:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
ODBC 驱动程序不支持所需的属性。
/1111/index.asp, 行74
-------------------------------------------------------------------------------
代码如下
<!--#include file="conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻管理</title>
<style type="text/css">
<!--
body {
font-family: "仿宋_GB2312";
font-size: 9pt;
}
a {
font-family: "仿宋_GB2312";
font-size: 9pt;
color: #333333;
}
.style1 {color: #0099CC}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="">
<div align="center">
<h3>新闻管理</h3>
</div>
<table align=center border='0' width='100%'>
<tr>
<td width="21%" align='left'><pre><a href='index.asp'>全部新闻</a><%
dim rs,rscate
set rs=server.CreateObject("adodb.recordset")
set rscate=server.CreateObject("adodb.recordset")
dim sql_where,iflag
iflag=request.QueryString("flag")
set rscate=conn.execute("select * from category order by cateid")
do while not rscate.eof
stile=rscate("catename")
cid=rscate("cateid")
%>|<a href="index.asp?flag=<%= cid %>"><%= stile %></a><% rscate.movenext
loop %>
</pre></td>
<td width="79%" align="right">
<pre><span class="style1"><a href="search.asp">新闻查询</a> <a href="PwdChange.asp">更改密码</a></span><%
if session("username")="admin" then
%><a href="cate_admin.asp"><font color=red></font>类别管理</a><a href="userlist.asp"><font color=red></font>用户管理</a><%
sql_where=""
else
sql_where="poster='"&trim(session("username"))&"'"
end if
%> <a href="exit.asp">退出登陆</a> </pre></td></TR></table>
<table height="20"width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#0099CC">
<tr>
<td width="55%"><div align="center"><font color="#FFFFFF">题目</font></div></td>
<td width="27%"><div align="center"><font color="#FFFFFF">时间</font></div></td>
<td width="9%"><div align="center"><font color="#FFFFFF">修改</font></div></td>
<td width="9%"><div align="center"><font color="#FFFFFF">选择</font></div></td>
</tr>
</table>
<%
if iflag="" then
if sql_where="" then
sql="select * from news order by posttime desc"
else
sql="select * form news where "&sql_where&" order by posttime desc"
end if
else
if sql_where="" then
sql="select * from news where cateid="&iflag&" order by posttime desc"
else
sql="select * from news where "&sql_where&"and cateid="&iflag&" order by desc"
end if
end if
rs.open sql,conn,1,1
if rs.eof then%>
<table><tr><td align="center">目前记录无!</td></tr></table>
<%
else
rs.pagesize=20
page=clng(request("page"))
if page<1 then page=1 end if
if page>rs.pagecount then page=rs.pagecount end if
for i=1 to rs.pagesize
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC" >
<tr>
<td width="55%"><a href="newsview.asp?id=<%= rs("id") %>" onClick="return newwin(this.href)"><% rs(title) %></a></td>
<td width="27%" align="center"><%= rs("posttime") %></td>
<td width="9%" align="center"><a href="newsedit.asp?id="<%= rs("id") %>"" onClick="return newwin(this.href)">修改</a></td>
<td width="9%" align="center"><input type="checkbox" name="checkbox" id="<%= rs("id") %>"></td>
</tr>
</table>
<%rs.movenext()
next
if rs.pagecount>1 then
%>
<table><tr><td>分页:</td>
<%
for i=1 to rs.pagecount
%>
<td><a href="index.asp?flag="&iflag&"&page="&i&""><%= "&i&" %></a></td>
</tr></table>
<%next
end if
end if
%>
<p> </p>
<pre></p>
</pre>
</form>
</body>
</html>
红色标注语句为74行
当rs.open sql出现如下错误信息:
ADODB.Recordset 错误 '800a0e7d'
连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。
/1111/index.asp, 行74
当rs.open sql,conn,1,1出现如下错误信息:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
ODBC 驱动程序不支持所需的属性。
/1111/index.asp, 行74
[此贴子已经被作者于2007-6-23 18:16:50编辑过]