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

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

错误类型:
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
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
这不能直接从表中获取吗?

2007-03-29 16:42
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
那应该怎样做才能获取表中的gongsi字段?

2007-03-29 16:49
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
不用条件where gongsi='"&amp;rs("gongsi")&amp;"' 了吗?

2007-03-29 16:56
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
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
你这样是获取某家公司呀~~~


我要是是公司产品的显示

2007-03-29 17:23
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
已经有另外一个文件查出哪家公司拉

现在就产品的问题了




具体代码该怎么写呀???/

2007-03-29 17:35
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 

这就是有获取公司的的代码,那该如何才能获取某家公司的所有产品??


<body leftmargin="0" topmargin="0">
<p>
<table width="260" border="0" align="center" cellpadding="0" cellspacing="0" class="border">

<tr class="topbg">
<td colspan="8"><table width="100%" height="172" border="0" cellpadding="0" cellspacing="1">
<%
set rs=server.createobject("adodb.recordset")
dim sql
sql="select * from baojianpin order by date DESC"
if request.QueryString("type")<>"" then
sql="select * from baojianpin order by date DESC"
end if

page=request.querystring("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
rs.open sql,conn,3,1
if rs.eof then
%>
<tr>
<td height="24" colspan="2">
<div align="center"><font color="#FF0000" size="3">暂时没有记录!</font></div> </td>
</tr>
<%
response.end
else
rs.pagesize=12
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0

dim id(),gongsi(),tupian()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve id(i),gongsi(i),tupian(i)
id(i)=rs("id")
gongsi(i)=rs("gongsi")
tupian(i)=rs("tupian")
rs.movenext
loop
end if
rs.close
%>
<tr>
<%for i = 1 to ubound(id)%>

<td HEIGHT="140">
<a href="baojianpinxx.asp?id=<%=id(i)%>" target="_blank">
<img border="1" src="
<%
if trim(tupian(i))="" then
response.Write("images/none.jpg")
else
response.Write(trim(tupian(i)))
end if
%>
" width="100" height="100"></a><br><div align="center" class="STYLE4"><br>
<%=left(gongsi(i),8)%></div></td>

<td HEIGHT="140">
<iframe border="0" frameborder="0" noresize scrolling="no" width="160" height="120"
src="../baojianpin/chanpin_list1.asp"></iframe>
</td>
<%a=a+1%>
<%if a>2 then %>
</tr>
<tr>
<%a=0%>
<%end if%>
<%next%>
</tr>
</table></td>
</tr>
</table>
<p>
<%
set rs=nothing
conn.close
set conn=nothing
%>
</p>
</p>
</body>

[此贴子已经被作者于2007-3-30 9:43:40编辑过]


2007-03-30 09:42
yfen258
Rank: 1
等 级:新手上路
帖 子:266
专家分:0
注 册:2006-3-31
收藏
得分:0 
哪来的gongsi='"& request("gongsi") &"'呀,还是不行


能不能具体点

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



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

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