| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 383 人关注过本帖
标题:[求助]循环循环出问题
只看楼主 加入收藏
diana
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-3-23
收藏
 问题点数:0 回复次数:1 
[求助]循环循环出问题

请您帮忙看看,怎么老是出问题呢?好郁闷哦~~`````````
提示说:“
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/sos/search2.asp ”
到底问题出在了什么地方?

代码如下:


<!--#include file="conn.asp"-->

<%
sub_number=trim(request.Form("sub_number"))

set rs=server.CreateObject("adodb.recordset")
sql="select * from basket where sub_number='"&sub_number&"' order by basket_id DESC "
rs.open sql,conn,3,3
if rs("sub_number")<>sub_number then
response.write "没有此订单"
response.end
else
%>

<html>

<body>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="731"><%=rs("sub_number")%></td>
</tr>
</table>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="195">商品名称</td>
<td width="195">折扣价格</td>
<td width="139">数量</td>
<td width="64">金额</td>
<td width="138">&nbsp; </td>
</tr>

<% do while not rs.eof%>

<tr>
<td><%=rs("pro_mingcheng")%></td>
<td><%=rs("pro2")%></td>
<td><%=rs("pro3")%></td>
<td><%=rs("pro4")%></td>
</tr>

<%rs.movenext
loop
%>


</table>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="328">&nbsp;</td>
<td width="403">总金额(产品金额+配送费用)=<%=rs("cash")%></td>
</tr>
</table>
</body>
</html>
<%end if%>

搜索更多相关主题的帖子: include 记录 color file 
2006-03-25 13:05
无根泉
Rank: 2
等 级:新手上路
威 望:4
帖 子:853
专家分:0
注 册:2004-11-4
收藏
得分:0 

<%
sub_number=trim(request.Form("sub_number"))

set rs=server.CreateObject("adodb.recordset")
sql="select * from basket where sub_number='"&sub_number&"' order by basket_id DESC "
rs.open sql,conn,3,3
if not rs.eof then'先判断有没有记录,再判断是否相等
if rs("sub_number")<>sub_number then
response.write "没有此订单"
response.end
end if
%>

<html>

<body>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="731"><%=rs("sub_number")%></td>
</tr>
</table>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="195">商品名称</td>
<td width="195">折扣价格</td>
<td width="139">数量</td>
<td width="64">金额</td>
<td width="138">&nbsp; </td>
</tr>

<% do while not rs.eof%>

<tr>
<td><%=rs("pro_mingcheng")%></td>
<td><%=rs("pro2")%></td>
<td><%=rs("pro3")%></td>
<td><%=rs("pro4")%></td>
</tr>

<%rs.movenext
loop
%>


</table>
<table width="731" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="328">&nbsp;</td>
<td width="403">总金额(产品金额+配送费用)=<%=rs("cash")%></td>
</tr>
</table>
</body>
</html>
<%end if%>


我很菜,但我很努力!
2006-03-25 13:29
快速回复:[求助]循环循环出问题
数据加载中...
 
   



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

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