| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 413 人关注过本帖
标题:做了个数据列表,明明有记录,可是在页面中没有显示
取消只看楼主 加入收藏
yushan_0008
Rank: 1
等 级:新手上路
帖 子:82
专家分:0
注 册:2009-6-16
结帖率:86.96%
收藏
 问题点数:0 回复次数:0 
做了个数据列表,明明有记录,可是在页面中没有显示
if founderr then
  call diserror()
  response.End
end if
sql="select * from newwys where news_id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
  sql="update allcount set newscount = newscount - 1"
  conn.execute(sql)
response.redirect "admin_news.asp"
end if
end if
dim totalnews,Currentpage,totalpages,i
sql="select * from newwys order by news_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<HTML><HEAD><TITLE>管理中心</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="inc/admin.css" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >
<%if request.QueryString("action")="" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=zonelovebk style="border-collapse: collapse">
<img src="tupian/lingdao5.gif">
</table>
      <br>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
        <tr class=lanyuss>
          <td colspan="4">校内新闻管理</td>
        </tr>
        <tr class=lanyuqs align="center">
          <td width="50">编号</td>
          <td width="*">标题</td>
          <td width="150">时间</td>
          <td width="100">操作</td>
        </tr>
        <%if not rs.eof then
rs.Movefirst
rs.pagesize=adperpage
if trim(request("page"))<>"" then
    currentpage=clng(request("page"))
    if currentpage>rs.pagecount then
       currentpage=rs.pagecount
    end if
else
    currentpage=1
end if
    totaldiary=rs.recordcount
    if currentpage<>1 then
       if(currentpage-1)*adperpage<totaldiary then
          rs.move(currentpage-1)*adperpage
          dim bookmark
          bookmark=rs.bookmark
       end if
    end if
    if (totaldiary mod adperpage)=0 then
       totalpages=totaldiary\adperpage
    else
       totalpages=totaldiary\adperpage+1
    end if
i=0
do while not rs.eof and i<adperpage
%>
        <tr class=lanyuds>
          <td align="center"><%=rs("news_id")%> </td>
          <td><%=cutstr(formatstr(rs("news_title")),20,false,none)%></td>
<td align="center"><%=rs("news_date")%></td>
          <td align="center"><a href="admin_news.asp?id=<%=rs("news_id")%>&action=editnews#editnews">编辑</a>
            <a href="admin_news.asp?id=<%=rs("news_id")%>&action=delnews#delnews">删除</a></td>
        </tr>
        <%i=i+1
rs.movenext
loop
else
If rs.EOF And rs.BOF Then%>
        <tr class=lanyuds>
          <td colspan=4 align="center">当前还没有新闻!</td>
        </tr>
        <%end if
end if%>
        <form name="form2" method="post" action="admin_news.asp">
          <tr class=lanyuqs>
            <td colspan=4 align="right"><%=currentpage%>/<%=totalpages%>页,<%=totaldiary%>条记录/<%=adperpage%>篇每页.
              <%
i=1
dy10=false
showye=totalpages
if showye>10 then
dy10=true
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
              <%=i%>
              <%else%>
              <a href="admin_news.asp?page=<%=i%>"><%=i%></a>
              <%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
              <a href="admin_news.asp?page=<%=page%>" title="下一页">>></a>
              <%end if%>
            </td>
          </tr>
        </form>
      </table>
      <%end if
明明数据库中有4条记录,可是为什么显示不出来,但是page中有显示,显示了4条记录。高手帮忙看看~~
搜索更多相关主题的帖子: 数据 页面 记录 列表 
2009-09-01 11:45
快速回复:做了个数据列表,明明有记录,可是在页面中没有显示
数据加载中...
 
   



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

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