| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2342 人关注过本帖
标题:视图查询的语句出错是怎么回事呢?谢谢!!!
只看楼主 加入收藏
fengmnll118
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-3-10
收藏
 问题点数:0 回复次数:7 
视图查询的语句出错是怎么回事呢?谢谢!!!
<%  Diary_Id=request.QueryString("Diary_Id")
                 
                  set rss=server.CreateObject("ADODB.Recordset")
                 
                  sqll="select * from chaxun "
                  
                  rss.open sqll,conn,1,3
                        
           %>
"chaxun"为视图表!
错误是ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
搜索更多相关主题的帖子: 视图 语句 查询 
2008-03-10 15:54
xiapi
Rank: 1
等 级:新手上路
威 望:2
帖 子:305
专家分:0
注 册:2006-10-11
收藏
得分:0 
没有内容吧

没有什么能够阻挡,我对自由的向往,天马行空的生涯一颗心了无牵挂。
2008-03-10 15:56
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
使用下面的把显示的内容整个包起来
if not(rs.eof and rs.bof) then
response.write "要显示的"&rs("abc")&"数据库内容"
end if
2008-03-10 16:09
fengmnll118
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-3-10
收藏
得分:0 
你看看我的源文件把!谢谢~!
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<style type="text/css">
<!--
body,td,th {
    font-size: 12px;
}
body {
    background-image: url(image/bg.jpg);
}
.STYLE4 {
    font-size: 36pt;
    font-family: "楷体_GB2312";
    color: #993300;
}
.STYLE6 {font-size: 12px}
-->
</style><table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="844" height="140" valign="top"><span class="STYLE4">枫的季节</span></td>
  </tr>
</table>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="639" height="37" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="66" valign="top">  
    <div align="center">首页</div></td>
    <td width="66" valign="top"> 
    <div align="center">最新文章</div></td>
    <td width="61" valign="top"> 
    <div align="center" ><a href="landing.asp"> 登陆</a></div></td>
  </tr>
</table>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="162" height="436" valign="top"><table width="162" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="162" height="24"><span class="STYLE6">文章分类</span></td>
      </tr>
  </table>
      <table width="161" border="0" cellpadding="0" cellspacing="0">
         <%  set rs=server.CreateObject("ADODB.Recordset")
               sql="select * from Diary_List"
               rs.open sql,conn,1,1
           %>    
           <% do while not rs.eof %>
        <tr>
         <td width="161" height="27"><a href="diary.asp?Diary_List_Id=<%=rs("Diary_List_Id")%>"><%=title(rs("Diary_List_Title"))%></a></td>
        </tr>
        <% rs.movenext
              loop
            %>
      </table>
       <% if session("People_Name")<>"" then %>
      <table width="162" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="162" height="22">用户面板</td>
        </tr>
        <tr>
          <td height="136" valign="top"> 
            <p align="center">用户登陆:<%=session("People_Name")%></p>
            <p align="center"><a href="user_news.asp?People_Id=<%=session("People_Id")%>">修改资料:</p>
            <p align="center"><a href="goout.asp">推出登陆:</p>
        </tr>
      </table>
      <% end if %>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="163" height="27">最新日志</td>
        </tr>
      </table>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
       <%  set rst=server.CreateObject("ADODB.Recordset")
                sqt="select * from Diary order by Diary_Time desc"
                rst.open sqt,conn,1,3
            %>
            <%   m=1
              do while not rst.eof
                 if m>7 then
                 exit do
                end if
             %>      
        <tr>
          <td width="163" height="30">&nbsp;<a href="article.asp?Diary_Id=<%=rst("Diary_Id")%>"><%=title(rst("Diary_Title"))%></a></td>
        </tr>
        <%  m=m+1
              rst.movenext
               
               loop
             %>
      </table>
       
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="163" height="28">最新评论</td>
        </tr>
      </table>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <%  set rsx=server.CreateObject("ADODB.Recordset")
                sqx="select * from Review order by Review_Time desc"
                rsx.open sqx,conn,1,3
            %>
            <%   x=1
              do while not rsx.eof
                 if x>7 then
                 exit do
                end if
             %>      
        <tr>
       <td width="163" height="28">&nbsp; <a href="article.asp?Diary_Id=<%=rsx("Diary_Id")%>"><%=title(rsx("Review_Content"))%></a></td>
        </tr>
        <%  x=x+1
              rsx.movenext
               
               loop
             %>
      </table>
    
     <table width="160" border="0" cellpadding="0" cellspacing="0">
     <%  set rsw=server.CreateObject("ADODB.Recordset")
               sqlw="select count(*) as counts from Diary"
               rsw.open sqlw,conn,1,1 %>
              <%  set rsc=server.CreateObject("ADODB.Recordset")
               sqlc="select count(*) as counts from Review"
               rsc.open sqlc,conn,1,1 %>
               <%  set rsp=server.CreateObject("ADODB.Recordset")
               sqlp="select count(*) as counts from People"
               rsp.open sqlp,conn,1,1 %>
        <tr>
          <td height="21">用户统计</td>
        </tr>
        <tr>
          <td height="29">日志; <%=rsw("counts")%></td>
        </tr>
        <tr>
          <td height="32">评论; <%=rsc("counts")%></td>
        </tr>
        <tr>
          <td height="31"> <a href="user.asp">用户; <%=rsp("counts")%></a></td>
        </tr>
      </table></td>
    <td width="651" valign="top"><table width="660" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="660" height="24">&nbsp;</td>
      </tr>
    </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
      <%  set rss=server.CreateObject("ADODB.Recordset")
                  sqll="select * from Diary_People order by Diary_Time desc"
                  'sqll="select * from diary"
                  rss.open sqll,conn,1,3
                  rss.pagesize=20
               if rss.eof then
                  rss_total=0
               else
               rss_total=rss.recordcount
               end if
                 dim pageno
                 maxpage=rss.pagecount
                 getpageno=(request.QueryString("pageno"))
               if request.QueryString("pageno")="" then
                 pageno=1
               else
               
               if request.QueryString("pageno")>rss_total then
               pageno=rss_total
               end if
                 pageno=getpageno
               end if
               if not rss.eof then
                 rss.absolutepage=pageno
               end if            
           %>
          
        <tr>
          <td width="658" height="26"><%for i=1 to maxpage%>
              <a href="liuyan.asp?pageno=<%=i%>"><%=i%></a>
          <% next %> &nbsp;</td>
        </tr>
      </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="4">&nbsp;</td>
        </tr>
        <% i=1
              do while not rss.eof
              
              if i>rss.pagesize then  exit do  end if
              %>    
        
        <tr>
          <td width="112" height="30"><a href="diary.asp?Diary_List_Id=<%=rss("Diary_List_Id")%>"><%=rss("Diary_List_Title")%></a></td>
          <td width="320">&nbsp;<a href="article.asp?Diary_Id=<%=rss("Diary_Id")%>"><%=title(rss("Diary_Title"))%></a></td>
          <td width="97">&nbsp;<a href="user_news.asp?People_Id=<%=rss("People_Id")%>"><%=rss("People_Name")%></a></td>
          <td width="129">&nbsp;<%=rss("Diary_Time")%></td>
        </tr>
        <%
            i=i+1
            rss.movenext
               loop
             %>  
      </table></td>
    <td width="37" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
</table>
2008-03-10 16:46
fengmnll118
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-3-10
收藏
得分:0 
你看看我的源文件把!谢谢~!
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<style type="text/css">
<!--
body,td,th {
    font-size: 12px;
}
body {
    background-image: url(image/bg.jpg);
}
.STYLE4 {
    font-size: 36pt;
    font-family: "楷体_GB2312";
    color: #993300;
}
.STYLE6 {font-size: 12px}
-->
</style><table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="844" height="140" valign="top"><span class="STYLE4">枫的季节</span></td>
  </tr>
</table>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="639" height="37" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="66" valign="top">  
    <div align="center">首页</div></td>
    <td width="66" valign="top"> 
    <div align="center">最新文章</div></td>
    <td width="61" valign="top"> 
    <div align="center" ><a href="landing.asp"> 登陆</a></div></td>
  </tr>
</table>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="162" height="436" valign="top"><table width="162" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="162" height="24"><span class="STYLE6">文章分类</span></td>
      </tr>
  </table>
      <table width="161" border="0" cellpadding="0" cellspacing="0">
         <%  set rs=server.CreateObject("ADODB.Recordset")
               sql="select * from Diary_List"
               rs.open sql,conn,1,1
           %>    
           <% do while not rs.eof %>
        <tr>
         <td width="161" height="27"><a href="diary.asp?Diary_List_Id=<%=rs("Diary_List_Id")%>"><%=title(rs("Diary_List_Title"))%></a></td>
        </tr>
        <% rs.movenext
              loop
            %>
      </table>
       <% if session("People_Name")<>"" then %>
      <table width="162" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="162" height="22">用户面板</td>
        </tr>
        <tr>
          <td height="136" valign="top"> 
            <p align="center">用户登陆:<%=session("People_Name")%></p>
            <p align="center"><a href="user_news.asp?People_Id=<%=session("People_Id")%>">修改资料:</p>
            <p align="center"><a href="goout.asp">推出登陆:</p>
        </tr>
      </table>
      <% end if %>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="163" height="27">最新日志</td>
        </tr>
      </table>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
       <%  set rst=server.CreateObject("ADODB.Recordset")
                sqt="select * from Diary order by Diary_Time desc"
                rst.open sqt,conn,1,3
            %>
            <%   m=1
              do while not rst.eof
                 if m>7 then
                 exit do
                end if
             %>      
        <tr>
          <td width="163" height="30">&nbsp;<a href="article.asp?Diary_Id=<%=rst("Diary_Id")%>"><%=title(rst("Diary_Title"))%></a></td>
        </tr>
        <%  m=m+1
              rst.movenext
               
               loop
             %>
      </table>
       
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="163" height="28">最新评论</td>
        </tr>
      </table>
      <table width="163" border="0" cellpadding="0" cellspacing="0">
        <%  set rsx=server.CreateObject("ADODB.Recordset")
                sqx="select * from Review order by Review_Time desc"
                rsx.open sqx,conn,1,3
            %>
            <%   x=1
              do while not rsx.eof
                 if x>7 then
                 exit do
                end if
             %>      
        <tr>
       <td width="163" height="28">&nbsp; <a href="article.asp?Diary_Id=<%=rsx("Diary_Id")%>"><%=title(rsx("Review_Content"))%></a></td>
        </tr>
        <%  x=x+1
              rsx.movenext
               
               loop
             %>
      </table>
    
     <table width="160" border="0" cellpadding="0" cellspacing="0">
     <%  set rsw=server.CreateObject("ADODB.Recordset")
               sqlw="select count(*) as counts from Diary"
               rsw.open sqlw,conn,1,1 %>
              <%  set rsc=server.CreateObject("ADODB.Recordset")
               sqlc="select count(*) as counts from Review"
               rsc.open sqlc,conn,1,1 %>
               <%  set rsp=server.CreateObject("ADODB.Recordset")
               sqlp="select count(*) as counts from People"
               rsp.open sqlp,conn,1,1 %>
        <tr>
          <td height="21">用户统计</td>
        </tr>
        <tr>
          <td height="29">日志; <%=rsw("counts")%></td>
        </tr>
        <tr>
          <td height="32">评论; <%=rsc("counts")%></td>
        </tr>
        <tr>
          <td height="31"> <a href="user.asp">用户; <%=rsp("counts")%></a></td>
        </tr>
      </table></td>
    <td width="651" valign="top"><table width="660" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="660" height="24">&nbsp;</td>
      </tr>
    </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
      <%  set rss=server.CreateObject("ADODB.Recordset")
                  sqll="select * from Diary_People order by Diary_Time desc"
                  'sqll="select * from diary"
                  rss.open sqll,conn,1,3
                  rss.pagesize=20
               if rss.eof then
                  rss_total=0
               else
               rss_total=rss.recordcount
               end if
                 dim pageno
                 maxpage=rss.pagecount
                 getpageno=(request.QueryString("pageno"))
               if request.QueryString("pageno")="" then
                 pageno=1
               else
               
               if request.QueryString("pageno")>rss_total then
               pageno=rss_total
               end if
                 pageno=getpageno
               end if
               if not rss.eof then
                 rss.absolutepage=pageno
               end if            
           %>
          
        <tr>
          <td width="658" height="26"><%for i=1 to maxpage%>
              <a href="liuyan.asp?pageno=<%=i%>"><%=i%></a>
          <% next %> &nbsp;</td>
        </tr>
      </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="4">&nbsp;</td>
        </tr>
        <% i=1
              do while not rss.eof
              
              if i>rss.pagesize then  exit do  end if
              %>    
        
        <tr>
          <td width="112" height="30"><a href="diary.asp?Diary_List_Id=<%=rss("Diary_List_Id")%>"><%=rss("Diary_List_Title")%></a></td>
          <td width="320">&nbsp;<a href="article.asp?Diary_Id=<%=rss("Diary_Id")%>"><%=title(rss("Diary_Title"))%></a></td>
          <td width="97">&nbsp;<a href="user_news.asp?People_Id=<%=rss("People_Id")%>"><%=rss("People_Name")%></a></td>
          <td width="129">&nbsp;<%=rss("Diary_Time")%></td>
        </tr>
        <%
            i=i+1
            rss.movenext
               loop
             %>  
      </table></td>
    <td width="37" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
</table>
2008-03-10 16:50
fengmnll118
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-3-10
收藏
得分:0 
还有就是感觉视图中的数据显示不出来呢!这是怎么回事?
<%  set rss=server.CreateObject("ADODB.Recordset")
                  sqll="select Diary_List_Id,Diary_List_Title,Diary_Time,People_Name from Diary_People order by Diary_Time desc"
                  'sqll="select * from diary"
                  rss.open sqll,conn,1,3
                  rss.pagesize=20
               if rss.eof then
                  rss_total=0
               else
               rss_total=rss.recordcount
               end if
                 dim pageno
                 maxpage=rss.pagecount
                 getpageno=(request.QueryString("pageno"))
               if request.QueryString("pageno")="" then
                 pageno=1
               else
               
               if request.QueryString("pageno")>rss_total then
               pageno=rss_total
               end if
                 pageno=getpageno
               end if
               if not rss.eof then
                 rss.absolutepage=pageno
               end if            
           %>
          
        <tr>
          <td width="658" height="26"><%for i=1 to maxpage%>
              <a href="liuyan.asp?pageno=<%=i%>"><%=i%></a>
          <% next %> &nbsp;</td>
        </tr>
      </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="4">&nbsp;</td>
        </tr>
        <% i=1
              do while not rss.eof
              
              if i>rss.pagesize then  exit do  end if
              %>    
”Diary_People“视图中的数据显示不出来??
2008-03-10 16:57
fengmnll118
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-3-10
收藏
得分:0 
还有就是感觉视图中的数据显示不出来呢!这是怎么回事?
<%  set rss=server.CreateObject("ADODB.Recordset")
                  sqll="select Diary_List_Id,Diary_List_Title,Diary_Time,People_Name from Diary_People order by Diary_Time desc"
                  'sqll="select * from diary"
                  rss.open sqll,conn,1,3
                  rss.pagesize=20
               if rss.eof then
                  rss_total=0
               else
               rss_total=rss.recordcount
               end if
                 dim pageno
                 maxpage=rss.pagecount
                 getpageno=(request.QueryString("pageno"))
               if request.QueryString("pageno")="" then
                 pageno=1
               else
               
               if request.QueryString("pageno")>rss_total then
               pageno=rss_total
               end if
                 pageno=getpageno
               end if
               if not rss.eof then
                 rss.absolutepage=pageno
               end if            
           %>
          
        <tr>
          <td width="658" height="26"><%for i=1 to maxpage%>
              <a href="liuyan.asp?pageno=<%=i%>"><%=i%></a>
          <% next %> &nbsp;</td>
        </tr>
      </table>
      <table width="658" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="4">&nbsp;</td>
        </tr>
        <% i=1
              do while not rss.eof
              
              if i>rss.pagesize then  exit do  end if
              %>    
”Diary_People“视图中的数据显示不出来??
2008-03-10 16:58
天涯听雨
Rank: 2
来 自:东莞
等 级:论坛游民
威 望:4
帖 子:497
专家分:64
注 册:2007-8-25
收藏
得分:0 
不用看你代码,看报错就知道你的出错什么。很明显是没有记录的报错?

还用得找帖代码出来吗……

从明天起做幸福的人,喂马劈柴周游世界!
2008-03-10 17:01
快速回复:视图查询的语句出错是怎么回事呢?谢谢!!!
数据加载中...
 
   



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

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