| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 751 人关注过本帖
标题:求助,ASP搜索问题
只看楼主 加入收藏
cbaguohong
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-9-23
收藏
 问题点数:0 回复次数:3 
求助,ASP搜索问题
错误类型:
Active Server Pages, ASP 0113 (0x80004005)
超过了脚本运行的最长时间。可以为 Server.ScriptTimeOut 属性指定新值或更改 IIS 管理工具中的相应值来更改此限制。
/Search.asp


我的站里出现了这样的错误!当数据库多了的时候,就出现搜索超时,不能用!
求高手给与解决方法!谢谢!


以下是wearch.asp代码,请高手看看:

<%@ LANGUAGE=VBScript CodePage=936%>

<!--#include file="Inc/Const.asp"-->

<!--#include file="Inc/System.asp"-->

<!--#include file="Head.asp"-->

<%

Class_Name="搜索"

Page_Name="搜索 -- " & Web_Const(0)

Dim SearchSelectkey

IF Action="Userinfo" THEN

Selectkey=Loginuser_Id

SearchSelectkey=Session("Loginuser") & "发表的帖子"

Else

Selectkey=checkfSQLstr(Request.form("Selectkey"))

SearchSelectkey=Selectkey

End IF

    IF Selectkey="" THEN

        error_title="对不起,请输入查询关键字!"

        Call Page_check(3,0)

    End IF

    Call Page_Head()

    Call Page_iHead()

    Call Page_nHead()

    Set Rs_Manage=server.Createobject("Adodb.Recordset")

        IF Request.form("Searchclass")="Products" THEN

            Sql="Select * from Tx_Products where Products_Flag=1 And "

            IF Request.form("xSearch")="Products_Name" THEN

                Sql = Sql & "Products_Name like '%" & Selectkey & "%'"

            End IF

            IF Request.form("xSearch")="Products_Content" THEN

                Sql = Sql & "Products_Content like '%" & Selectkey & "%'"

            End IF

            Sql = Sql & "order by Products_Date desc"

        End IF

        IF Request.form("Searchclass")="News" THEN

            Sql="Select * from Tx_News where News_Flag=1 And "

            IF Request.form("xSearch")="News_Title" THEN

                Sql = Sql & "News_Title like '%" & Selectkey & "%'"

            End IF

            IF Request.form("xSearch")="News_Content" THEN

                Sql = Sql & "News_Content like '%" & Selectkey & "%'"

            End IF

            Sql = Sql & "order by News_Date desc"

        End IF

        IF Request.form("Searchclass")="Down" THEN

            Sql="Select * from Tx_Down where Down_Flag=1 And "

            IF Request.form("xSearch")="Down_Name" THEN

                Sql = Sql & "Down_Name like '%" & Selectkey & "%'"

            End IF

            IF Request.form("xSearch")="Down_Content" THEN

                Sql = Sql & "Down_Content like '%" & Selectkey & "%'"

            End IF

            Sql = Sql & "order by Down_Date desc"

        End IF

        IF Request.form("Searchclass")="bbs" THEN

            Sql="Select * from Tx_Bbs where Bbs_ClassId=Bbs_Id And Bbs_Flag=1 And Bbs_Title like '%" & Selectkey & "%' order by Bbs_Date desc"

        End IF

        IF Request.form("Searchclass")="ShopCode" THEN

            Sql="Select distinct Shop_Code,Shop_Date,Shop_Condition from Tx_Shop where Shop_Condition>=2 And Shop_Code=" & Selectkey & " order by Shop_Date desc"

        End IF

        IF Action="Userinfo" THEN

            Sql="Select * from Tx_Bbs where Bbs_ClassId=Bbs_Id And Bbs_UserId=" & Selectkey & " And Bbs_Flag=1 order by Bbs_Date desc"

        End IF

        Rs_Manage.open Sql,Conn,1,1

        %>

    <TABLE WIDTH="1005" BORDER="0" ALIGN="center" CEllPADDING="0" CELLSPACING="0">

        <TR>

        <TD VALIGN="top" CLASS="TABLE-Main">

            <DIV CLASS="search-top1"><SPAN STYLE="width:60%;">您搜索的关键字是:<SPAN CLASS="type-color2"><B><%=SearchSelectkey%></B></SPAN></SPAN><SPAN STYLE="width:40%;text-align:right;">共找到相关记录<SPAN CLASS="type-color2"><B><%=Rs_Manage.recordCount%></B></SPAN>条</SPAN></DIV>

                <%

                Dim xh

                Page_Nexterror=4

                Rs_Manage.PageSize = SearchMax_Class

                totalrec=Rs_Manage.RecordCount

                iPageSize=Rs_Manage.PageSize

                currentPage=request("page")

                IF currentpage="" THEN

                    currentpage=1

                Else

                    IF Not isChkInteger(currentPage) THEN response.Redirect "javascript:history.go(-1);"

                    currentpage=clng(currentpage)

                End IF

                IF totalrec Mod Cint(iPageSize)=0 THEN

                    n= totalrec \ Cint(iPageSize)

                Else

                    n= totalrec \ Cint(iPageSize)+1

                End IF

                IF not (Rs_Manage.bof And Rs_Manage.eof) THEN

                    Rs_Manage.MoveFirst

                    IF currentpage > n THEN currentpage = n

                    IF currentpage<1 THEN currentpage=1

                    Rs_Manage.Move (currentpage-1) * Cint(iPageSize)

                    xh=0

                    dim lineheight

                    While Not Rs_Manage.Eof And page_count<Cint(iPageSize)

                        page_count=page_count+1

                        xh=xh+1

                        IF page_count<>Rs_Manage.RecordCount  THEN

                            lineheight="<DIV CLASS='type-height2'></DIV>"

                        End IF

                        %>

                        <DIV CLASS="search-content">

                        <%IF Request.form("Searchclass")="Products" THEN%>

                        <B><%=xh%>.</B> <A HREF="Products.asp?Id=<%=Rs_Manage("Products_Id")%>" target="_blank"><B><%=replace(Rs_Manage("Products_Name"),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%></B></A>

                        <DIV CLASS="search-content1"><%=replace(gotTopic(nohtml(Rs_Manage("Products_Content")),150,1),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF

                        IF Request.form("Searchclass")="News" THEN%>

                        <B><%=xh%>.</B> <A HREF="News.asp?Id=<%=Rs_Manage("News_Id")%>" target="_blank"><B><%=replace(Rs_Manage("News_Title"),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%></B></A>

                        <DIV CLASS="search-content1"><%=replace(gotTopic(nohtml(Rs_Manage("News_Content")),100,1),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF

                        IF Request.form("Searchclass")="Down" THEN%>

                        <B><%=xh%>.</B> <A HREF="Down.asp?Id=<%=Rs_Manage("Down_Id")%>" target="_blank"><B><%=replace(Rs_Manage("Down_Name"),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%></B></A>

                        <DIV CLASS="search-content1"><%=replace(gotTopic(nohtml(Rs_Manage("Down_Content")),100,1),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF

                        IF Request.form("Searchclass")="bbs" THEN%>

                        <B><%=xh%>.</B> <A HREF="bbs_list.asp?Id=<%=Rs_Manage("Bbs_Id")%>" target="_blank"><B><%=replace(Rs_Manage("Bbs_Title"),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%></B></A>

                        <DIV CLASS="search-content1"><%=replace(gotTopic(nohtml(Rs_Manage("Bbs_Content")),100,1),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF

                        IF Request.form("Searchclass")="ShopCode" THEN

                        %>

                        <B><%=xh%>.</B> <%Response.Write " <a onClick=" & CHR(34) & "javascript:window.open('Shop.asp?Action=shopedit&Id=" & Rs_Manage("Shop_Code") & "','news','width=583,height=350,top=300,left=220,scrollbars=yes');return false;" & CHR(34) & " href=''><B>" & Rs_Manage("Shop_Code") & "</B></A> "%>

                        <DIV CLASS="search-content1">订单状态:<%

                        Select Case Rs_Manage("Shop_Condition")

                        Case "0"

                            Response.write "<FONT COLOR=ff0000>失效(无效订单)</FONT>"

                        Case "1"

                            Response.write "<FONT COLOR=ff0000>失效(有产品被删除)</FONT>"

                        Case "2"

                            Response.write "<B>未作任何处理</B>"

                        Case "3"

                            Response.write "用户已付出货款"

                        Case "4"

                            Response.write "服务商已收到货款"

                        Case "5"

                            Response.write "<FONT COLOR=ff0000>服务商已发出货</FONT>"

                        Case "6"

                            Response.write "用户已收到货"

                        Case "7"

                            Response.write "<u>订单交易成功</u>"

                        End Select

                        %>  

                        下单时间:<%=YearDami(Rs_Manage("Shop_Date"))%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF

                        IF Action="Userinfo" THEN%>

                        <B><%=xh%>.</B> <A HREF="bbs_list.asp?Id=<%=Rs_Manage("Bbs_Id")%>" target="_blank"><B><%=replace(Rs_Manage("Bbs_Title"),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%></B></A>

                        <DIV CLASS="search-content1"><%=replace(gotTopic(nohtml(Rs_Manage("Bbs_Content")),150,1),Selectkey,"<FONT COLOR=#FF0000>" & Selectkey & "</FONT>")%>

                        <%=lineheight%>

                        </DIV>

                        <%End IF%>

                        </DIV>

                        <%

                        lineheight=""

                    Rs_Manage.MoveNext

                    Wend

                End IF

            Rs_Manage.Close

            Set Rs_Manage=Nothing

            %>

            <DIV CLASS="search-top1"></DIV>

            <%

            Call Page_Next()

            %>    

        </TD>

        </TR>

    </TABLE>

    <%

    Call CloseConn()

    %>

     <!--#include file="foot.asp"-->
搜索更多相关主题的帖子: ASP 搜索 
2008-09-23 19:29
cbaguohong
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-9-23
收藏
得分:0 
高手帮个忙啊!不知道怎么修改了!
2008-09-23 20:45
duanzelong
该用户已被删除
收藏
得分:0 
提示: 作者被禁止或删除 内容自动屏蔽
2008-09-23 22:04
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
修改Server.ScriptTimeout的值(s)可以增加脚本可以执行的时间,但是根本的问题是你搜索算法要改变改变,该索引的要索引,该不开放全文的要不开放。
2008-09-23 22:47
快速回复:求助,ASP搜索问题
数据加载中...
 
   



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

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