| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1269 人关注过本帖
标题:for i=1 to rs.recordcount next
只看楼主 加入收藏
bambo8
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-8-17
收藏
 问题点数:0 回复次数:4 
for i=1 to rs.recordcount next

先申明一下:下面这程序是对的!

<form action="delete.asp" method="post">
<table width="80%">
<%
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("news.mdb")
conn.open
sql="select * from news order by news_time desc"
set rs=conn.execute(sql)
if not rs.bof then
rs.movefirst
end if
do while not rs.eof
%>
<tr ><td width="20%" bgcolor="#ebebeb" align="center">是否删除:<input type="checkbox" name=<%=rs("news_id")%>></td>
<td bgcolor="#ebebeb" width="15%"><%=rs("news_type")%></td><td bgcolor="#ebebeb" width="65%"><%=rs("news_title")%></td></tr>
<%
rs.movenext
loop
%>
<tr><td width="100%" colspan="3" bgcolor="#ebebeb" align="center"><center><p>
<input type="submit" value="删除" name="b1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="清除" name="b2">
</center></td></tr></table></form>

请问一下上面用红色写的程序为什么不能改写成:

for i=1 to rs.recordcount


next

还有请问一下这个对应的asp程序应该怎么写!(也就是选中复选框,点击“删除”,就能把数据库中对应的删除!)checkbox我不太会用,所以问大家一下!

谢谢!

搜索更多相关主题的帖子: next recordcount conn news 
2006-08-23 17:31
wyg4859
Rank: 2
等 级:新手上路
威 望:4
帖 子:883
专家分:0
注 册:2006-8-2
收藏
得分:0 
应该是for i=1 to rs.recordcount-1吧,然后再把那个判断if放在for的下面就行了

http://www.找到组织!找到党!
2006-08-23 17:44
seal520_2008
Rank: 1
等 级:新手上路
帖 子:239
专家分:0
注 册:2006-6-13
收藏
得分:0 
因为你是用set rs=conn.execute(sql)方式打开的
你用rs.open 打开就可以了

每晚0:00上线 msn:seal520_2008@ myblog:http://seal.
2006-08-23 18:48
bambo8
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-8-17
收藏
得分:0 
请问一下这个对应的asp程序应该怎么写!(也就是选中复选框,点击“删除”,就能把数据库中对应的删除!)checkbox我不太会用,所以问大家一下!
2006-08-23 19:40
ming206
Rank: 2
来 自:重庆
等 级:等待验证会员
威 望:3
帖 子:545
专家分:7
注 册:2005-8-2
收藏
得分:0 
JAVASCRIPT不会?先学习,不要是都问~!

外贸综合平台:E贸通
2006-08-23 19:47
快速回复:for i=1 to rs.recordcount next
数据加载中...
 
   



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

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