本帖最后由 套路王子 于 2019-6-27 11:15 编辑
ADODB.Field 错误 '80020009'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/admin/sd_listuser.asp,行 0
代码如下 数据库用的是sqlserver2008
<!--#include file="sd_conn.asp"-->
<!--#include file="sd_cookies.asp"-->
<!--#include file="../sd_site.asp"-->
<%
Set Rs=Server.CreateObject("adodb.recordSet")
act=request.QueryString("act")
id=request.QueryString("id")
keyword=request.form("keyword")
if keyword="" or keyword="输入用户名..." then keyword=request.QueryString("keyword")
if act="del" then
conn.execute("delete [sd_user] where sd_Userid="&id)
conn.execute("delete [sd_show] where sd_Userid='"&id&"'")
conn.execute("delete [sd_article] where sd_Userid='"&id&"'")
conn.execute("delete [sd_xarticle] where sd_Userid='"&id&"'")
conn.execute("delete [sd_jkarticle] where sd_Userid='"&id&"'")
conn.execute("delete [sd_zxarticle] where sd_Userid='"&id&"'")
conn.execute("delete [sd_domain] where sd_Userid='"&id&"'")
response.write"<SCRIPT language=JavaScript>alert('已删除一条编号为[ "&delete&" ]的会员相关信息!');"
response.write"location='sd_listuser.asp';</SCRIPT>"
end If
%>
<html>
<head>
<TITLE>会员管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/Admin_css.css" type=text/css rel=stylesheet>
<script language="javascript" src="js/prototype.js"></script>
</head>
<body>
<table height="1" border="0" cellpadding="3" cellspacing="1" bgcolor="#F2F9E8" class="admintable1">
<tr>
<td colspan="10" class="admintitle">会员管理(3-品牌推广,2-品牌认证,1-普通认证,0-未认证)</td>
</tr>
<tr bgcolor="E8FBD1" align="center">
<td width="8%" height="30">ID</td>
<td>会员名</td>
<td width="10%">会员级别</td>
<td width="18%">所属公司</td>
<td width="15%">联系QQ</td>
<td width="10%">Email</td>
<td width="4%">金币</td>
<td width="12%">更新时间</td>
<td width="10%">操作</td>
</tr>
<%
dim pagecount,page,Spage,Epage,recordcount,i
Const PAGESIZE=15
Const PARTSIZE=10
Const AboutSize=8
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
if act<>"search" then
sql="select * from [sd_User] Order by sd_Userid DESC"
rs.open sql,conn,1,1
else
sql="select * from [sd_User] Order by sd_Userid DESC"
rs.open sql,conn,1,1
rs.filter = "sd_User like '%"&keyword&"%'"
end if
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
page = 1
elseif page > pagecount then
page = pagecount
end if
if RS.EOF then
Response.Write("<tr><td height='30' colspan='8'><p align='center'>没有找到任何记录</p></td></tr>")
else
if recordcount > 0 then RS.AbsolutePage = page
for i=1 to PAGESIZE
if RS.EOF then exit for
%>
<tr align="center" <%If i/2=Cint(i/2) Then response.write "bgcolor=#F7FDEF" Else Response.write "bgcolor=#FFFFFF" End If %> >
<td height="30"><%=rs("sd_Userid")%></td>
<td><%=rs("sd_user")%></td>
<td><%set rsjb = Server.CreateObject("ADODB.RecordSet")
sqljb = "select sd_cn_rz from sd_show where sd_userid="&rs("sd_userid")&""
rsjb.open sqljb, conn,1,1
%>
<%=rsjb("sd_cn_rz")%>
<%rsjb.close
set rsjb=nothing%></td>
<td><%set rsc = Server.CreateObject("ADODB.RecordSet")
sql = "select sd_namejx,sd_name,id from sd_show where sd_userid="&rs("sd_userid")&""
rsc.open sql, conn,1,1
%><a href="../idc/<%=rsc("id")%>.html" target="_blank" title="<%=rsc("sd_name")%>"><%rsc.close
set rsc=nothing%>
<%set rsidc = Server.CreateObject("ADODB.RecordSet")
sqlidc = "select sd_name from sd_show where sd_userid="&rs("sd_userid")&""
rsidc.open sqlidc, conn,1,1
%><%=rsidc("sd_name")%><%rsidc.close
set rsidc=nothing%></a>
</td>
<td><a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin=<%=rs("sd_qq")%>&Site=1&Menu=yes><img src="http://wpa.qq.com/pa?p=1:<%=rs("sd_qq")%>:1" align="middle" border="0" /></a><%=rs("sd_qq")%></td>
<td><%=rs("sd_email")%></td>
<td><%=rs("sd_Points")%></td>
<td><%=rs("sd_RegTime")%></td>
<td><a href="sd_listuser_02.asp?id=<%=rs("sd_Userid")%>">编辑</a> <a href="javascript:delrec('<%=rs("sd_Userid")%>')">删除</a></td>
</tr>
<%
RS.MoveNext()
next
end if
%>
<tr>
<td height="40" colspan="10">
<%
if pagecount > 0 then
%><span class='black12'>共<span class='calendar_checked'><%=recordcount%></span>条信息 | 共有<span class='calendar_checked'><%=pagecount%></span>页 | 每页<span class='calendar_checked'><%=pagesize%></span>条记录 | 当前第<span class='calendar_checked'><%=page%></span>页</span> |
<%
if page>1 then
if keyword<>"" and act="search" then %>
<a href='sd_listuser.asp?page=1&act=search&keyword=<%=keyword%>' style="text-decoration: none"><font color="#009300">首页</font></a> | <a href='sd_listuser.asp?act=search&keyword=<%=keyword%>&page=<%=page-1%>' style="text-decoration: none"><font color="#009300">上一页</font></a> |
<%else%>
<a href='sd_listuser.asp?page=1' style="text-decoration: none"><font color="#009300">首页</font></a> | <a href='sd_listuser.asp?page=<%=page-1%>' style="text-decoration: none"><font color="#009300">上一页</font></a> |
<%end if
else%>
首页 | 上一页 |
<%end if
if pagecount>page then
if keyword<>"" and act="search" then %>
<a href='sd_listuser.asp?act=search&keyword=<%=keyword%>&page=<%=page+1%>' style="text-decoration: none"><font color="#009300">下一页</font></a> | <a href='sd_listuser.asp?act=search&keyword=<%=keyword%>&page=<%=pagecount%>' style="text-decoration: none"><font color="#009300">尾页</font></a>
<%else%>
<a href='sd_listuser.asp?page=<%=page+1%>' style="text-decoration: none"><font color="#009300">下一页</font></a> | <a href='sd_listuser.asp?page=<%=pagecount%>' style="text-decoration: none"><font color="#009300">尾页</font></a>
<%end if
else%>
下一页 | 尾页
<%end if
end if
rs.close
set rs=nothing
%>
</td></tr>
<tr>
<td height="40" colspan="8" align='center'>
<form name="search" method="post" action="sd_listuser.asp?act=search">
模糊搜索:<input name="keyword" type="text" class="iptxt" value="输入用户名..." onClick="javascript:if(this.value='输入用户名...') this.value=''">
<input type="submit" onClick="sousuo()" value="搜索会员"/></form>
<SCRIPT language=Javascript>
function delrec(code)
{
if (confirm("您确认要删除吗?该会员所属所有网站也将被删除!")==true)
{
window.location.href="sd_listuser.asp?act=del&id="+code
}
}
function sousuo()
{
if($F('keyword')=='' || $F('keyword')=='输入用户名...'){
alert('请输入你要搜索别名!');
return false;
}
$("search").submit();
}
//-->
</script>
</td></tr>
</table>
<!--#include file="sd_copy.asp"-->
</body>
</html> |