标题:求大神帮个忙,问题我也说不清楚,进来帮忙看一下吧
只看楼主
lovinlik
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-9-6
结帖率:0
已结贴  问题点数:20 回复次数:1 
求大神帮个忙,问题我也说不清楚,进来帮忙看一下吧
我有一个asp+mssql的程序,想添加一个会员收入排行,找到作者要了他的页面文件,可是不知道怎么用,直接覆盖的话在排行榜的位置那显示
ADODB.Recordset 错误 '800a0cc1'
在对应所需名称或序数的集合中,未找到项目。

/index.asp,行 170

 是不是要在数据库里添加个表啊什么的才行?求大神解答,
这是index.asp里面排行榜的源码,大神帮忙看一下,谢谢
程序代码:
  <h3>推荐人数排行榜</h3>
          </div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" >
             
             <%
             
             
             set rs=server.createobject("adodb.recordset")
sqls="select  * from userlist order by id desc"
rs.open sqls,conn,1,3
If Not rs.eof Then 
    Do While Not rs.eof 
        
        rs("totaltj")=0
        rs("monthtj")=0
        rs.update

    rs.movenext
    loop
End if
    
    
    set rs=server.createobject("adodb.recordset")
sqls="select  * from userlist order by id desc"
rs.open sqls,conn,1,3
If Not rs.eof Then 
    Do While Not rs.eof 
        set rs2=server.createobject("adodb.recordset")
        sqls="select  * from userlist where formuser='"&rs("username")&"' "
        rs2.open sqls,conn,1,1
        If Not rs2.eof Then 
            rs("totaltj")=rs2("totaltj")+1
        End If
        
        set rs2=server.createobject("adodb.recordset")
        sqls="select  * from userlist where formuser='"&rs("username")&"' and regtime>='"&DateAdd("d",-30,Date())&"' and regtime<='"&DateAdd("d",1,Date())&"'  "
        rs2.open sqls,conn,1,1
        If Not rs2.eof Then 
            rs("monthtj")=rs2("monthtj")+1
        End if

        rs.update
    rs.movenext
    loop
End if
%>
                
                
                <td align="center" height=20 >排名</td>
                <td align="center" >用户</td>
                <td align="center" >当月推荐</td>
                <td align="center" >总推荐</td>
                
              
            
          <%
set rss=server.createobject("adodb.recordset")
sqls="select top 10 * from userlist order by totaltj desc"
rss.open sqls,conn,1,1
i = 0
do while not rss.eof
i = i + 1
%>
        
           <tr bgcolor="">
                <td align="center" height=20><%=i%></td>
                <td align="center" ><%=rss("username")%></td>
                <td align="center" ><%=rss("monthtj")%></td>
                <td align="center" ><%=rss("totaltj")%></td>
                
              </tr>
            

<%
rss.movenext
loop
rss.close
%>
       
            </table>
      </div> 
      </div> 




    <div class="right w235">
        <div class="listbox">
        <div class="title">
          <h3>当前金币排行</h3>
          </div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" >
             
             
                
                
                <td align="center" height=20 >排名</td>
                <td align="center" >用户</td>
                <td align="center" >当月收入</td>
                <td align="center" >总收入</td>
                
              
            
          <%
set rss=server.createobject("adodb.recordset")
sqls="select top 10 * from userlist order by jifen desc"
rss.open sqls,conn,1,1
i = 0
do while not rss.eof
i = i + 1
%>
        
           <tr bgcolor="">
                <td align="center" height=20><%=i%></td>
                <td align="center" ><%=rss("username")%></td>
                <td align="center" ><%
set rs=server.createobject("adodb.recordset")
sql="select sum(jifen) from jifenlist where userid="&rss("id")&" and time>='"&DateAdd("d",-30,Date())&"' and time<='"&DateAdd("d",1,Date())&"'  "
rs.open sql,conn,1,1
If Not rs.eof Then 
    response.write rs(0)
Else
    response.write "0"
End if%></td>
                <td align="center" ><%=rss("jifen")%></td>
                
              </tr>
            

<%
rss.movenext
loop
rss.close
%>
       
            </table>
      </div> 
      </div> 
搜索更多相关主题的帖子: 排行榜 数据库 
2012-09-06 19:26
netlin
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:24
帖 子:544
专家分:4308
注 册:2012-4-9
得分:20 
根据错误提示,你检查一下这句:
sql="select sum(jifen) from jifenlist where userid="&rss("id")&" and time>='"&DateAdd("d",-30,Date())&"' and time<='"&DateAdd("d",1,Date())&"'  "
'下面这两句用于调试
response.write sql   
response.end


做自己喜欢的事!
2012-09-07 08:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-380856-1-1.html




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

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