| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 6702 人关注过本帖
标题:[求助]在对应所需名称或序数的集合中未找到项目
只看楼主 加入收藏
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
 问题点数:0 回复次数:42 
[求助]在对应所需名称或序数的集合中未找到项目

"在对应所需名称或序数的集合中未找到项目" ,网上查下来好象都是数据库某个字段名字写错了或不存在之类的,但我的应该不是这方面的问题,

错误类型:
ADODB.Recordset (0x800A0CC1)
在对应所需名称或序数的集合中,未找到项目。
/blog/baojianpin/chanpin_list1.asp, 第 56 行
红色的是第 56 行

<!--#include file="conn.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style3 { color: #000000;
font-size: 9px;
}
.style4 {color: #000000}
-->
</style>
<style type="text/css">
<!--
body {
background-image:
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<style type="text/css">
<!--
.style2 {font-size: 14px}
body,td,th {
color: #333333;
}
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
color: #666666;
text-decoration: none;
}
a:active {
color: #FF3300;
text-decoration: none;
}
a:hover {
text-decoration: none;
color: #3399FF;
}
.STYLE5 {font-size: 12px}
.STYLE8 {font-size: 16px}
-->
</style>
</head>
<body>
<p>
<table align="center" width="500" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from baojianpin where gongsi='"&rs("gongsi")&"' order by date DESC"
rs.open sql,conn,1,1
%>
<td align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<!--DWLayoutTable-->
<tr class="topbg">
<td height="48"><div align="left"></div>
<table width="499" height="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<% if rs.eof then %>
<tr>
<td width="410" height="200"><div align="center" class="STYLE5"><font size="1">暂时没有产品!</font></div></td>
</tr>
<%
else
rs.pagesize=10
totalrecord=rs.recordcount
totalpages=rs.pagecount
maxpages=rs.pagesize
if thepage<1 then
thepage=1
end if
if thepage>totalpages then
thepage=totalpages
end if
if thepage=1 then
showContent
else
if (thepage-1)*maxpages<totalrecord then
rs.move (thepage-1)*maxpages
dim bookmark
bookmark=rs.bookmark
showContent
end if
end if
rs.close
end if

sub showContent
dim i
dim k
k=(totalrecord-maxpages*(thepage-1))+1
i=0
do while not (rs.eof or err)
k=k-1
%>
<tr>
<div align="left">
<td height="20" align="left" class="STYLE5">·<a href="baojianpinxx.asp?id=<%=rs("id")%>" target="_blank">
<%=left((rs.Fields.Item("chanpin").Value),10)%>
</a>
</td>
</div>
</tr>
<%
i=i+1
if i>=Maxpages then exit do
rs.Movenext
loop
end sub
%>
</table></td>
</tr>
<tr>
<td width="225" height="37">&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>


</table>
</td>
</tr>
</table>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</p>

搜索更多相关主题的帖子: 序数 名称 项目 
2007-03-29 16:31
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
sql="select * from baojianpin where gongsi='"&rs("gongsi")&"' order by date DESC"


红色部分哪来滴?

其实我很低调,只是你不知道...
2007-03-29 16:39
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
这不能直接从表中获取吗?

2007-03-29 16:42
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 

<%
set rs=server.createobject("adodb.recordset")
sql="select * from baojianpin where gongsi='"&rs("gongsi")&"' order by date DESC"
rs.open sql,conn,1,1
%>

"&rs("gongsi")&"这个应该是个变量才对
如果是获取表单中的元素的话 应该是Request.Form("gongsi")

其实我很低调,只是你不知道...
2007-03-29 16:46
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
那应该怎样做才能获取表中的gongsi字段?

2007-03-29 16:49
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
sql="select * from baojianpin order by date DESC"

再写rs("gongsi")就是当前第一条记录的gongsi字段的值

其实我很低调,只是你不知道...
2007-03-29 16:52
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
不用条件where gongsi='"&amp;rs("gongsi")&amp;"' 了吗?

2007-03-29 16:56
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
你想查找什么符合什么样条件的记录啊?

其实我很低调,只是你不知道...
2007-03-29 16:59
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
动态查找数据表里面某个公司的所有产品,公司不是固定某家的,有很多家,点哪家公司哪家公司的所有产品就显示出来

2007-03-29 17:02
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
不是从表单中获取,而是从数据表

2007-03-29 17:03
快速回复:[求助]在对应所需名称或序数的集合中未找到项目
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028226 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved