ADODB.Recordset 错误 '800a0cc1'在对应所需名称或序数的集合中,未找到项目。
先贴一下代码:<%@ LANGUAGE = VBScript.Encode %>
<!--#include file="public/header.asp"-->
<!--#include file="home1.asp"-->
<!--#include file="function.asp"-->
<script language="JavaScript">
<!--
function typename() {
return(confirm('\n请三思而行!!!\n\n真的要进行这项删除操作吗?\n\n注意,此操作确认后将不可恢复!\n'));
}
//-->
</script>
<%
if userid<>"" then
set rs2=server.CreateObject("adodb.recordset")
rs2.open "Select dcc_management from userinf where userid='"&userid&"'",conn,3
if rs2.recordcount<>0 then
dcc_management=trim(rs2("dcc_management"))
end if
rs2.close
set rs2=nothing
end if
dim zhuid,typeid,zhu,types,zhuanid
dim sql
typeid=Request.QueryString("typeid")
zhuid=Request.QueryString("zhuid")
if zhuid<>"" then
if not IsNumeric(zhuid) then%>
<script language=vbscript>
MsgBox "参数错误!",16,"系统信息"
location.href = "javascript:history.back()"
</script>
<%
response.end
end if
end if
if typeid<>"" then
if not IsNumeric(typeid) then%>
<script language=vbscript>
MsgBox "参数错误!",16,"系统信息"
location.href = "javascript:history.back()"
</script>
<%
response.end
end if
end if
Set rs= Server.CreateObject("ADODB.Recordset")
if typeid<>"" then
sql = " select type.type,zhu.zhu,zhu.zhuid from type,zhu where type.zhuid=zhu.zhuid and type.typeid="&typeid
rs.open sql,conn,1,1
if not rs.eof then
types=rs("type")
zhu=rs("zhu")
else%>
<script language=vbscript>
MsgBox "参数错误!",16,"系统信息"
location.href = "javascript:history.back()"
</script>
<%
response.end
end if
else
sql="select zhu from zhu where zhuid="&zhuid
rs.open sql,conn,1,1
if not rs.eof then
zhu=rs("zhu")
else%>
<script language=vbscript>
MsgBox "参数错误!",16,"系统信息"
location.href = "javascript:history.back()"
</script>
<%
response.end
end if
end if
set rs=server.CreateObject("adodb.recordset")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs1("home")%> -- <%=zhu%> -- <%=types%></title><link rel="stylesheet" type="text/css" href="css/style.css">
<body marginwidth="0" leftmargin="0" bgcolor="#FFFFFF" topmargin="0" marginheight="0" >
<table width=100% border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#E3EEF9">
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="20" valign="bottom" bgcolor="#0099FF">
<font color=#0772b1>当前位置:</font><a href="sharefile.asp"><%=rs1("home")%>首页</a> >
<%if zhuanid="" then%>
<a href="sort.asp?zhuid=<%=zhuid%>"><%=zhu%></a> <%if typeid <> "" then%> > <%=types%> <%end if%> <%else%> <%=zhuantype%>专题
<%end if%>
</td>
</tr>
</table>
<%if typeid<>"" then%>
<%dim CurPage
CurPage=request.querystring("CurPage")
if not isnumeric(CurPage) or CurPage="" then
CurPage=1
else
if CurPage<1 then
CurPage=1
else
CurPage=int(CurPage)
end if
end if
sql="select * from learn_zhuan_dept_type_userinf where typeid='"&typeid&"' order by title"
rs.open sql,conn,3,1
PAGESIZE = rs1("duo")
PARTSIZE = rs1("zhu")
dim TotalPages,Totalcount,StartPageNum,EndPageNum,i,ii
RS.PageSize=PAGESIZE
TotalPages = RS.PageCount
Totalcount =INT(RS.recordcount)%>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr>
<td bordercolor="#FFFFFF">
<%if TotalCount=0 then%>
<a href="javascript:window.history.go(-1)"><img src="images/sorry.gif" width="186" height="150" border="0"></a>
<%else%>
<a name="dot"></a>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="576">□ 总共有 <%=TotalCount%> 个文档,目前为第 <%=CurPage%> 页</td>
<td width="163" align="right">
<%if CurPage>1 then%>
<a href="sort.asp?zhuid=<%=zhuid%>&typeid=<%=typeid%>&CurPage=<%=CurPage-1%>">上一页</a>
<%end if
if CurPage<TotalPages then%>
<a href="sort.asp?zhuid=<%=zhuid%>&typeid=<%=typeid%>&CurPage=<%=CurPage+1%>">下一页</a>
<%end if%>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FF99FF">
<tr>
<td width="14%" height=22 align="center" bgcolor="#0000FF"><font color="#FFFFFF">=
文档搜索 =</font> </td>
<form name="form1" method="GET" action="search.asp">
<td width="30%" height=22 align="center"> <input name="keyword" class=kuang size="50">
</td>
<td width="18%"> <input name="submit" type="submit" class=kuang value=" 搜索 ">
</td>
</form>
<td width="12%" height=21 bgcolor=#0000FF>
<div align=center><font color=#ffffff> <img src="images/cons.gif">
快捷切换 </font></div></td>
<td width="26%" align="center" bordercolor="#a6d3ec">
<select name="select" onChange="javascript:window.location.href=this.options[this.selectedIndex].value">
<%
if typeid<>"" then
sql="SELECT * FROM type WHERE zhuid="&zhuid
lu="typeid"
lus="type"
lu2=typeid
thname="sort.asp?zhuid="&zhuid&"&typeid"
else
sql="SELECT * FROM zhu"
lu="zhuid"
lus="zhu"
lu2=zhuid
thname="sort.asp?zhuid"
end if
set rsswitch=server.CreateObject("adodb.recordset")
rsswitch.open sql,conn,1,1
do while not rsswitch.bof and not rsswitch.eof%>
<option value="<%=thname%>=<%=rsswitch(lu)%>" <%if int(rsswitch(lu))=int(lu2) then Response.Write "selected"%>><%=rsswitch(lus)%></option>
<%rsswitch.movenext
loop
rsswitch.close
set rsswitch=nothing%>
</select>
</td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="22" align="center">
<tr bgcolor="#33ccff" bordercolor="#FFCC00">
<td colspan="2" nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">文档编号</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">文件名称</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">版本号</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">发表日期</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">所属分类</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">所属专题</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">上传者</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">部门</font></td>
<td nowrap bordercolor="#00CCFF" bgcolor="#00CCFF"><font color="#6600FF">所属部门</font></td>
<td width="30" nowrap bordercolor="#00CCFF" bgcolor="#00CCFF">
<div align="center">修改</div></td>
<td width="30" nowrap bordercolor="#00CCFF" bgcolor="#00CCFF">
<div align="center">删除</div></td>
</tr>
<%if not rs.eof and not rs.bof then
If CurPage>RS.Pagecount Then
CurPage=RS.Pagecount
end if
RS.AbsolutePage=CurPage
rs.CacheSize = RS.PageSize
do while (Not RS.Eof) and (II<RS.PageSize)%>
<tr bgcolor="99ffff">
<td width="3">
<%fileformat=Getformat(rs("fileurl1"))
set formatrs=Server.CreateObject("ADODB.Recordset")
formatsql="select fileformatico from fileformat where fileformattype='"&fileformat&"'"
formatrs.open formatsql,conn,1,1
if formatrs.eof or formatrs.bof then%>
<img src="0.gif" width="18" height="18">
<%else%>
<img src="images/<%=formatrs("fileformatico")%>" width="18" height="18">
<%end if
formatrs.close
set formatrs=nothing%>
</td>
<td>
<%if rs("enprint")="yes" then%>
<a href="#dot" onclick="window.open('<%=rs("fileurl1")%>','sample','toolbar=yes,scrollbars=yes,resizable=yes')"><%=rs("title")%></a>
<%else%>
<a href="#dot" onclick="window.open('<%=rs("fileurl1")%>','sample','toolbar=no,scrollbars=yes,resizable=yes')"><%=rs("title")%></a>
<%end if%>
</td>
<td><%=rs("filename")%></td>
<td><%=rs("ver")%></td>
<td><%=rs("publishdate")%></td>
<td><%=rs("type")%></td>
<td><%=rs("zhuantype")%></td>
<td><%=rs("username")%></td>
<td><%=rs("depttype")%></td>
<td><%=rs("suosubumen")%></td>
<%if bracketid=3 or dcc_management="yes" then%>
<td width="30"> <div align="center"><a href="edit.asp?id=<%=rs("id")%>"><img src="images/edit.gif" alt="修 改" width="16" height="16" border="0"></a></div></td>
<td width="30"> <div align="center"><a href="delete.asp?typeid=<%=rs("typeid")%>&id=<%=rs("id")%>" onClick="return(typename())"><img src="images/no.gif" alt="删 除" border="0"></a></div></td>
<%else%>
<td></td>
<td></td>
<%end if%>
<%rs.movenext
II=II+1
loop%>
</tr>
</table>
<%StartPageNum=1
do while StartPageNum+PARTSIZE<=CurPage
StartPageNum=StartPageNum+PARTSIZE
Loop
EndPageNum=StartPageNum+(PARTSIZE-1)
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
end if%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>● 页次:<%=CurPage%>/<%=TotalPages%> 页</td>
<td align="right" nowrap>[
<%fangye()%>
] </td>
</tr>
</table>
<%end if%>
<br>
</td>
</tr>
</table>
<%else%>
<table width="95%" border="0" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#3366FF"><img src="images/g1.gif" width="8" height="8">
<font color="#FFFFFF">文档分类</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<%sql="SELECT typeid,type,zhuid FROM type WHERE zhuid="&zhuid
rs.open sql,conn,3,1
if not rs.eof then
do while not rs.eof%><tr align="center">
<td width="20%"><a href=sort.asp?zhuid=<%=rs("zhuid")%>&typeid=<%=rs("typeid")%>><%=rs("type")%></a></td>
<%RS.MoveNext%>
<td width="20%"><%if not RS.EOF then%><a href=sort.asp?zhuid=<%=rs("zhuid")%>&typeid=<%=rs("typeid")%>><%=rs("type")%></a>
<%RS.MoveNext
end if%></td>
<td width="20%"><%if not RS.EOF then%><a href=sort.asp?zhuid=<%=rs("zhuid")%>&typeid=<%=rs("typeid")%>><%=rs("type")%></a>
<%RS.MoveNext
end if%></td>
<td width="20%"><%if not RS.EOF then%><a href=sort.asp?zhuid=<%=rs("zhuid")%>&typeid=<%=rs("typeid")%>><%=rs("type")%></a>
<%RS.MoveNext
end if%></td>
</tr>
<%
loop
end if
rs.close%>
</table>
</td>
</tr>
</table>
<br>
<%end if%>
<br>
<!--#include file="public/foot.asp"-->
</td></tr></table>
</body></html>
<%
rs1.close
set rs1=nothing
conn.close
set conn=nothing
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&" ......"
else
cutstr=tempstr
end if
end function
function fangye()
dim fa_ye
fa_ye="sort.asp?zhuid="&zhuid&"&typeid="&typeid&"&"
if CurPage>PARTSIZE then response.write"<a href="&fa_ye&"CurPage="&StartPageNum-1&"> ← </a> "
For I=StartPageNum to EndPageNum
if I<>CurPage then
response.write"<a href="&fa_ye&"CurPage="&I&">"&I&"</a> "
else
response.write"<b>>"&I&"<</b> "
end if
Next
if EndPageNum<RS.Pagecount then response.write"<a href="&fa_ye&"CurPage="&EndPageNum+1&"> → </a>"
end function
%>
在添加<td><%=rs("suosubumen")%></td> 这一行后,报ADODB.Recordset 错误 '800a0cc1'在对应所需名称或序数的集合中,未找到项目。在数据库表中已经存在这个列,并且在提交页面可以提交数据,在数据库中也能看到,可是在这个页面确提取不出来,查了一下,好像说是没select,但是不知道该加在哪里,高手们帮们看一下!
[ 本帖最后由 kepa520 于 2010-12-22 09:00 编辑 ]