| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 440 人关注过本帖
标题:我是个新手请各位高手帮看一下,做一个论坛提交的时候显示
只看楼主 加入收藏
luohui123456
Rank: 1
来 自:广西
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-6-17
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
我是个新手请各位高手帮看一下,做一个论坛提交的时候显示
  <%
      dim sql,rs,news_id
news_id=request.QueryString("news_id")
      sql="select * from news where news_id='"&news_id&"'"
Set rs=Server.CreateObject("ADODB.recordset")
rs.Open sql,conn,1,1 %>
              <tr>
                <td height="13"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=rs("news_content")%></td>
              </tr>
               <% rs.close
            set rs=nothing
            %>
            
            </table>
          </td>
          </tr>
        </table></td>
      </tr>
      <tr> </tr>
    </table>
    <table width="768" border="0" height="100" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
               <%
      sql="select * from huifu where news_id='"&news_id&"'"
Set rs=Server.CreateObject("ADODB.recordset")
rs.Open sql,conn,1,1 %>
<% if not rs.eof and not rs.bof then  
               dim p_no
 if Request.QueryString("p_no")="" then
   p_no=1
 else
   p_no=cint(Request.QueryString("p_no"))
 end if
 rs.pagesize=3
 rs.absolutepage=p_no  
 p=rs.pagesize  
  do while not rs.eof and p>0
                 %>
            <tr>
              已回复 <td><%=rs("huifu")%></td>
            </tr>
             <%
               p=p-1

              rs.movenext
                 loop
             %>
    </table>
    <%'===================== 分页导航条 =============================

 Response.Write "请选择: "
 if p_no=1 then
   Response.Write "第一页&nbsp;"
   Response.Write "上一页&nbsp;"
 else
   Response.Write "<a href=newscontent.asp>第一页</a>&nbsp;"
   Response.Write "<a href=newscontent.asp?p_no="&p_no-1&">上一页</a>&nbsp;"
 end if
 if p_no=rs.pagecount then
   Response.Write "下一页&nbsp;"
   Response.Write "最后一页</a>"
 else
   Response.Write "<a href=newscontent.asp>第一页</a>&nbsp;"
   Response.Write "<a href=newscontent.asp?p_no="&p_no-1&">上一页</a>&nbsp;"
 end if
else
 Response.Write "没有相关记录!"
end if %>
<%rs.close
set rs=nothing
%>
    <table width="768" border="0" height="150" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
             <tr>
               <td><form id="form1" name="form1" method="post" action="newscontent.asp?active=ture">
               
               
           <label>
                   <textarea name="content" id="content" cols="105" rows="10"></textarea>
                   </label>
                   <div align="center">
                 <label>
                     <input type="submit" name="button" id="button" value="回复" />
                     <input type="submit" name="button2" id="button2" value="修改" />
                   </label>
                   </div>
                 </form>
               </td>
            </tr>
    </table>
    <%
sql="insert into huifu (huifu) values('" &huifu& "')"
conn.execute(sql)

conn.close

set conn=nothing
%>
    </td>
  </tr>
  <tr>
    <td><img src="images/di.gif" width="768" height="50" /></td>
  </tr>
</table>
</body>
</html>

我提交表单时显示:BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录
搜索更多相关主题的帖子: where nothing 
2011-06-18 10:57
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:20 
记录集为空,最常见的错误

----我怎能在别人的苦难面前转过脸去----
2011-06-18 14:01
快速回复:我是个新手请各位高手帮看一下,做一个论坛提交的时候显示
数据加载中...
 
   



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

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