| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1115 人关注过本帖
标题:[求助]各位大哥大姐来看看
只看楼主 加入收藏
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
你试试
<!--#include file="conn.asp"-->
<!--#include file="bigclass.asp"-->
<HTML>
<HEAD>
<TITLE>紫雨轩 - <%=dn("bigclassname")%> - 家园</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="images/text.css" type=text/css rel=stylesheet>
<BODY text=#000000 bgColor=#f7dbce leftMargin=0 background=images/bg.gif
topMargin=0>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center
background=images/to_bj2.gif border=0>
  <TBODY>
  <TR>
    <TD background=images/to_bj.gif colSpan=3 height=8></TD></TR>
  <TR>
    <TD width=20 background=images/to_bj2.gif height=19></TD>
    <TD class=top vAlign=bottom align=right background=images/to_bj2.gif
    height=19>   </TD>
    <TD width=20 background=images/to_bj2.gif height=19></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#d5dac2
border=0>
  <TBODY>
  <TR>
    <td><FONT
color=#ff0000><a href="/">首页</a> > <a href="Article.asp?bigclassname=<%=dn("bigclassname")%>" target="_blank"><%=dn("bigclassname")%></a> > 全部</FONT></td>
    <TD align=right width="2%" height=11> </TD></TR>
  <TR>
    <TD background=images/to_bj3.gif colSpan=3 height=3></TD></TR></TBODY></TABLE>
<table cellspacing=0 cellpadding=0 width=778 align=center bgcolor=#f6f6f1
border=0>
  <tbody>
    <tr>
      <td colspan=2> </td>
    </tr>
    <tr>
      <td valign=top width=187>
        <table height="96%" cellspacing=0 cellpadding=0 width="100%" border=0>
          <tbody>
            <tr>
              <td valign=top width=187>
                <table height="100%" cellspacing=0 cellpadding=0 width="96%"
            align=center border=0>
                  <tbody>
                    <tr>
                      <td valign=top align=middle height=19><img height=119 alt=散文
                  src="images/1.gif" width=172> <br>
                          <br></td>
                    </tr>
                    <tr>
                      <td valign=bottom background=images/to_bj2.gif height=19> □ <b>热门文章</b></td>
                    </tr>
                    <tr>
                      <td valign=top align=middle>
                        <table cellspacing=0 cellpadding=0 width="90%" align=center
                  border=0>
                          <tbody>
                            <tr>
                              <td height=10></td>
                            </tr>
                          </tbody>
                        </table>
                        <table cellspacing=1 cellpadding=0 width="96%" align=center
                  bgcolor=#ffffff border=0>
                          <tbody>
<%exec="select * from Article where bigclassname='"&request.querystring("bigclassname")&"' order by hits desc,id desc"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
do while not rs.eof%>
                            <tr>
                        <td bgcolor=#e7ebd6>·<%=rs("title")%><br></td>
                            </tr>
<%rs.movenext
loop
rs.close%>
                            <tr>
                              <td align=right bgcolor=#e7ebd6>>更多推荐 </td>
                            </tr>
                          </tbody>
                        </table>
                        <form name=search action=../search/search.asp method=get>
                          <table cellspacing=0 cellpadding=0 width="100%" align=center
                  border=0>
                            <tbody>
                              <tr>
                                <td></td>
                              </tr>
                              <tr>
                                <td bgcolor=#ced2bf height=1></td>
                              </tr>
                              <tr>
                                <td bgcolor=#ffffff></td>
                              </tr>
                              <tr>
                                <td align=middle bgcolor=#ffffff><br>
                                  查询内容
                                    <select class=input name=mysel>
                                      <option value=1-2
                          selected>作者名称</option>
                                      <option value=1-1>文章标题</option>
                                      <option value=2-1>长篇小说</option>
                                      <option
                          value=4-1>日记标题</option>
                                    </select>
                                    <br>
                                    <br>
                                    关键字
                                    <input
                        class=input maxlength=20 size=12 name=textfield>
                                </td>
                              </tr>
                              <tr>
                                <td align=middle bgcolor=#ffffff height=30><input
                        type=image height=20 width=52 src="images/search.gif"
                        border=0 name=imageField>
                                </td>
                              </tr>
                              <tr>
                                <td bgcolor=#ced2bf height=1></td>
                              </tr>
                            </tbody>
                          </table>
                        </form>
                        <br></td>
                    </tr>
                  </tbody>
              </table></td>
            </tr>
          </tbody>
      </table></td>
      <td width=3 background=images/07bj.gif height="100%"></td>
      <td valign=top>
        <table height="95%" cellspacing=0 cellpadding=0 width="96%" align=center
      border=0>
          <tbody>
            <tr>
              <td><font color=#999999>  </font></td>
            </tr>
            <tr>
              <td class=editorword valign=top bgcolor=#e7ebd6><img height=22
            src="images/left.gif" width=24><br>
                  <table height=95 cellspacing=0 cellpadding=0 width="96%"
            align=center bor????der=0>
                    <tbody>
                      <tr>
                        <td width="39%" background=images/bbg1.gif
                  height=22><b>文章标题</b></td>
                        <td width="13%" background=images/bbg1.gif
                height=22><div align="center"><b>作 者</b></div></td>
                        <td width="22%" background=images/bbg1.gif
                height=22><div align="center"><b>日 期</b></div></td>
                        <td width="8%" background=images/bbg1.gif
                height=22><div align="center"><b>阅读</b></div></td>
                        <td width="7%" background=images/bbg1.gif
                height=22><div align="center"><b>评论</b></div></td>
                        <td width="11%" background=images/bbg1.gif
                height=22><div align="center"><b>发表</b></div></td>
                      </tr>
<%exec="select * from Article where bigclassname='"&request.querystring("bigclassname")&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
do while not rs.eof%>
                      <tr>
                        <td background=images/bbg.gif height=22><div align="left"><img src="images/soul.gif">:<a href="ArticleShow.asp?ArticleID=<%=rs("ArticleID")%>" target="_blank"><%=rs("title")%></a></div></td>
                        <td background=images/bbg.gif height=22><div align="center"><%=rs("Author")%></div></td>
                        <td background=images/bbg.gif height=22><div align="center"><%=rs("time")%></div></td>
                        <td background=images/bbg.gif height=22><div align="center"><%=rs("Hits")%></div></td>
                        <td background=images/bbg.gif height=22><div align="center"></div></td>
                        <td background=images/bbg.gif height=22><div align="center"><%=rs("Editor")%></div></td>
                      </tr>
<%rs.movenext
loop
rs.close%>
                      <tr valign=top>
                        <td align=right colspan=7>
                          <form action=article.asp method=get>
                            第1页  首页    上一页 下一页 跳至
                            <input class=input maxlength=20 size=7 name=page>
                          
                          <input type=image src="images/button.gif"
                  border=0 name=imageField>
                        </form></td>
                      </tr>
                    </tbody>
                </table></td>
            </tr>
          </tbody>
        </table>
</td>
    </tr>
  </tbody>
</table>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
  <TBODY>
  <TR>
    <TD bgColor=#f6f6f1 height=10></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=778 align=center border=0>
  <TBODY>
  <TR>
    <TD background=images/below_bg.gif height=9></TD></TR>
  <TR bgColor=#e9eae5>
    <TD vAlign=center align=middle height=10></TD></TR>
  <TR>
    <TD background=images/05bj.gif bgColor=#f7f6ed height=2></TD></TR>
  <TR align=middle>
    <TD background=images/03bj.gif height=19><BR><SPAN
      class=reg><BR>
    </SPAN></TD></TR></TBODY></TABLE></BODY></HTML>
2005-08-29 13:01
wjzhihua1
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2005-8-15
收藏
得分:0 
版主大哥,执行出现这个错误
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1。
2005-08-29 16:04
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
bigclassname='"&request.querystring("bigclassname")&"'"改成
bigclassname like '%"&request.querystring("bigclassname")&"%'" 再试试
2005-08-29 16:08
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
太厉害了
我看到长代码就头晕了

2005-08-29 16:18
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
呵呵
request.querystring("bigclassname") 还没取到值 当然出错了
2005-08-29 16:24
wjzhihua1
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2005-8-15
收藏
得分:0 
可以了,我把那个ID改了一下就好了,谢谢版主大哥,
对了版主大哥如何能句控制数据库查询显示的字数.
2005-08-29 16:29
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
left(rs("字段"),10)
2005-08-29 16:31
wjzhihua1
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2005-8-15
收藏
得分:0 
嗯,问题解决了,真的自从发现这个论谈以来真的学了不少东西,因为这里的人都很热心帮人 谢谢TVB 谢谢版主,谢谢热心帮助偶的人,当然了,如果偶有粉丝的话一并谢上,嘿嘿

[此贴子已经被作者于2005-8-29 16:48:52编辑过]

2005-08-29 16:47
无根泉
Rank: 2
等 级:新手上路
威 望:4
帖 子:853
专家分:0
注 册:2004-11-4
收藏
得分:0 
以下是引用islet在2005-8-29 9:33:53的发言: 明白了 一个页面有一个set rs=server.createobject("adodb.recordset")就行了 用完了rs.close然后又可以用了 就像这样 rc.open exec,conn,1,1 do while not rs.eof …… rs.movenext loop rs.close exec="select top 10 * from Article order by hits desc" rs.open exec,conn,1,1 ……
一个页里用一个set rs=server.createobject("adodb.recordset") 我遇到这样一个问题,就是数据库中有记录,但是显示不出来,把上一个rs.close set rs=nothing再重新 set rs=server.createobject("adodb.recordset")就行了,这是什么原因???

我很菜,但我很努力!
2005-08-29 17:20
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
你管原因干啥 又不是讲课

我一般不建立那么多recordset对象 我感觉越多越影响效率(虽然感觉不是很明显)能少则少


建立其他类型(例如FSO)对象有时也要nothing一下才让再建
2005-08-29 17:25
快速回复:[求助]各位大哥大姐来看看
数据加载中...
 
   



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

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