标题:只要我点击这个页面就会使网站打不开,asp代码有没有什么不妥的地方!
只看楼主
byf19800212
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-5-11
 问题点数:0 回复次数:1 
只要我点击这个页面就会使网站打不开,asp代码有没有什么不妥的地方!
Default.rar (3.79 KB)
网站地址是:tdlz.  
错误代码是: 错误 '800a0e7d'

连接无法用于执行此操作。在此上下文中它可能已被关闭或无效。

/info/Default.asp,行 157
 
 


<!--#include file = "../Include/DBClass.inc.asp"-->

<%
sMenu_Status = 1
%>

<%
Dim s_type, s_areaid, TitleName
s_type = GetSafeInt(Trim(Request("type")),0)
s_areaid = GetSafeStr(Trim(Request("areaid")))

Select Case s_type
Case 1
    TitleName = "土地转出信息"
Case 2
    TitleName = "土地转入信息"
Case Else
    TitleName = "所有土地信息"
End Select

Dim sAreaID, sArea_T, sAreaID_I, sCount
sAreaID = ""
sArea_T = ""
If s_areaid = "" Then s_areaid = sAreaID

Set sCount = oConn.Execute("SELECT C_ID From Sxzx_NewsCata WHERE C_Type = 4 and C_RootID = '"& sAreaID &"'")
If Not sCount.EOF Then
    sAreaID_I = sCount(0)
Else
    sAreaID_I = 0
End If
%>

<HTML>
<HEAD>
<TITLE><%=Homepage_Title%>-<%=TitleName%>列表</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<link rel="stylesheet" href="../Css/Style.css" type="text/css">
<script type="text/javascript">
<!--
    function SelectTimeFun(name) {
        var Left = (screen.width - 165) / 2;
        var Top = (screen.height - 165) / 2;
        var ItemName = document.all(name);
        var timestring = showModalDialog("../Include/SelectTime.htm", "", "dialogLeft:"+Left+";dialogTop:"+Top+";dialogWidth:165px; dialogHeight:165px; edge:raised;help:off;status:off;scroll:off");

        if(timestring){
            ItemName.value = timestring;  
        }
    }
//-->
</script>

</HEAD>

<BODY>
<!--#include file = "../Include/Header.asp"-->
<table border="0" align="center" cellpadding="0" cellspacing="0" class="TableControl">
  <tbody>
    <tr>
      <td valign="top" class="TableListLeft"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF">
        <tr>
          <td class="TableListBar"><%
    '开始读取当前位置的信息
    Dim aRs, aSql, aRootID, aTitle, aLen, i, TempStr

    TempStr =  "&nbsp;&nbsp;<img src='../News/Images/Arror.gif' align='absmiddle'>&nbsp;您现在的位置:<a href='"& RootUrl &"/' target='_parent'>"& Homepage_Title &"</a> &gt;&gt; <a href='Default.asp' target='_parent'>土地流转信息</a>"
    aLen = Int(Len(Trim(s_areaid))/4)
    For i = 1 To aLen                    ' 如果不想显示根目录名称,请把这里的i=0 修改为 i = 1
        aRootID = Mid(s_areaid,1,4*i)
                    
        Set aRs = Server.CreateObject( "ADODB.Recordset" )
        aSql = "SELECT * FROM Sxzx_NewsCata WHERE C_Type = 4 and C_RootID = '"& aRootID &"' ORDER BY C_ID DESC"
        aRs.Open aSql, oConn, 0, 1
        If Not aRs.Eof Then
            aTitle = aRs("C_Title")
        End If
        aRs.Close
        Set aRs = Nothing
        If i = aLen Then
            TempStr = TempStr & "&nbsp;&gt;&gt;&nbsp;<font color='#FF0000'>"& aTitle &"</font>"
        Else
            TempStr = TempStr & "&nbsp;&gt;&gt;&nbsp;<a href='Default.asp?type="& s_type &"&areaid="& aRootID &"' target='_parent'>"& aTitle &"</a>"
        End If
    Next
    Response.Write TempStr
    %>
          </td>
        </tr>
      </table>
        <br>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><div id="title_1"><%=TitleName%></div></td>
        </tr>
      </table>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
            <table border="0" cellpadding="0" cellspacing="0" class="TableBar">
              <tr>
                <td height="10"></td>
              </tr>
            </table>
              <br>
              <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" style="word-break:break-all;">
<%
    Dim P_TblName, P_ID, P_FldName, P_strCondition, P_FldSort, P_OrderType, P_PageSize
    Dim totalPage, perPage, PageNo
    Dim Str
   
    Str = ""
    If Info_Check = 1 Then Str = Str &" and D_isCheck = 1"
    If s_type > 0 Then Str = Str &" and D_Type = "& s_type
    If s_areaid <> "" Then Str = Str &"and D_AreaID LIKE '"& s_areaid &"%'"
   
    P_TblName = "Sxzx_InfoData"
    P_ID = "D_ID"                    '主键名
    P_FldName = "*"                    '要显示的列名
    P_strCondition = Str
    P_FldSort = "D_isTop Desc, D_ID Desc"
    P_PageSize = InfoListNum        '每页显示条数
    perPage = P_PageSize
   
    PageNo = Clng(Request("PageNo"))
    If PageNo <= 0 or PageNo = "" Then PageNo = 1

    reCom.Parameters.Append reCom.CreateParameter("@tblName",202,1,200,P_TblName)
    reCom.Parameters.Append reCom.CreateParameter("@KeyID",202,1,150,P_ID)
    reCom.Parameters.Append reCom.CreateParameter("@fldName",202,1,500,P_FldName)
    reCom.Parameters.Append reCom.CreateParameter("@strCondition",202,1,1000,P_strCondition)
    reCom.Parameters.Append reCom.CreateParameter("@fldSort",202,1,200,P_FldSort)
    reCom.Parameters.Append reCom.CreateParameter("@PageSize",3,1,6,P_PageSize)
    reCom.Parameters.Append reCom.CreateParameter("@page",3,1,6,PageNo)
    reCom.Parameters.Append reCom.CreateParameter("@Count",3,2,6,10)
    Set oRs = reCom.Execute()

    If oRs.Bof and oRs.Eof then
        Set reCom = Nothing
        Response.write "<tr><td>&nbsp;&nbsp;暂时没有任何信息!</td></tr>"
    Else
        Do While Not oRs.Eof
%>               <tr>
                  <td width="3%" height="24"><img src="../News/Images/Dot_1.gif" nowrap></td>
                  <td background="../News/Images/Bg.gif" height=26><%
                    Response.Write "<a href='Show.asp?id="& oRs("D_ID") &"' class='tt1' target='_blank'>"
                    If oRs("D_Type") = 1 Then
                        Response.Write oRs("D_Name") & "转出" & oRs("D_Place") & "土地"& oRs("D_Acreage") &"亩"
                    Else
                        Response.Write oRs("D_Name") & "需求" & oRs("D_Place") & "土地"& oRs("D_Acreage") &"亩"
                    End If
                    Response.Write "</a>"
                    %> </td>
                  <td width="22%" background="../News/Images/Bg.gif"><a title="<%=oRs("D_AddTime")%>"><font color="#FF9900">[ </font><font color=#FF9900><%=FormatDateTime(oRs("D_AddTime"),vbshortdate)%> 浏览:<%=oRs("D_Hits")%> ]</font></a></td>
</tr>
<%
        oRs.Movenext
        Loop

        oRs.Close()
        TotalPage = reCom(7)
        Set oRs = Nothing
        Set reCom = Nothing
    End if
%>
              </table>
              <br>
              <table border="0" cellpadding="0" cellspacing="0" class="TableBar">
                <tr>
                  <td height="25"><%Response.Write PageBar(totalPage,perPage,Pageno,"Default.asp?type="& s_type &"&areaid="& s_areaid &"&pageno=","class='tt3'")%></td>
                </tr>
              </table></td>
          </tr>
      </table>
      <p>&nbsp;</p></td>
      <td valign=top class="TableListRight">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="TableListLeftItem">
          <tr>
            <td class="TableListLeftTitle">区域导航</td>
          </tr>
          <tr>
            <td height="10"></td>
          </tr>
          <tr>
            <td>
            <script type="text/javascript" src="../Include/dTree.js"></script>
            <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td>
    <script type="text/javascript">
     d = new dTree('d');
     d.add(<%=sAreaID_I%>,-1,'所有地区','Default.asp?type=<%=s_type%>&areaid=<%=sAreaID%>','','_parent');
        <%
            Dim cRs, cSql, cCode, k, cCount
            Set cRs = Server.CreateObject( "ADODB.Recordset" )
            cSql = "SELECT * FROM Sxzx_NewsCata Where C_Type = 4 and C_RootID LIKE '"& sAreaID &"%' and C_Deep > "& Int(Len(sAreaID)/4) &" ORDER BY C_SortID, C_RootID"
            cRs.Open cSql, oConn, 1, 3

            Do While Not cRs.EOF
                If cRs("C_Deep") = 1 Then
                    k = 0
                Else
                    cCode = Mid(Trim(cRs("C_RootID")),1,Len(Trim(cRs("C_RootID")))-4)
                    Set cCount = oConn.Execute("SELECT C_ID From Sxzx_NewsCata WHERE C_Type = 4 and C_RootID = '"& cCode &"'")
                    k = cCount(0)
                End If
                Response.Write "d.add("& cRs("C_ID") &","& k &",'"& Trim(cRs("C_Title")) &"','Default.asp?type="& s_type &"&areaid="& Trim(cRs("C_RootID")) &"','', '_parent');" & vbCrlf
            cRs.MoveNext
            Loop
              cRs.Close()
              Set cRs = Nothing
        %>
   document.write(d);
   //d.openAll();
    </script>
    </td>
              </tr>
            </table>
            </td>
          </tr>
          <tr>
            <td height="10"></td>
          </tr>
        </table>
        <br>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="TableListLeftItem">
          <form action="SearchResult.asp" method="post" name="searchLeftForm">
            <tr>
              <td class="TableListLeftTitle">土地转让信息搜索</td>
            </tr>
            <tr align="center">
              <td height=30>土地类型: <%=SelectCase("landtype","0001","")%></td>
            </tr>
            <tr align="center">
              <td height=25>开始日期:
              <input name="date_f" type="text" class="inputtext" style="width:106">
              <input name="button" type="button" class="inputbutton" value="选择" onClick="SelectTimeFun('date_f');"></td>
            </tr>
            <tr align="center">
              <td height=25>截止日期:
              <input name="date_t" type="text" class="inputtext" style="width:106">
              <input name="button1" type="button" class="inputbutton" value="选择" onClick="SelectTimeFun('date_t');"></td>
            </tr>
            <tr align="center">
              <td height=25>所属区域: <select name="areaid" style="width:150" class="inputlist">
                <%Response.Write Show_Class("Sxzx_NewsCata", "==&gt; 所有地区 &lt;==", "","",4)%>
              </select></td>
            </tr>
            <tr align="center">
              <td height="30">信息方向:
                <select name="type" style="width:150">
                  <option value="1">转出</option>
                  <option value="2">转入</option>
                </select>
              </td>
            </tr>
            <tr align="center">
              <td height=25>关 键 词: <input type="text" name="keywords" style="width:150" class="inputtext"></td>
            </tr>
            <tr align="center">
              <td height=30><input name="bystr" type="radio" value="1" checked> 标题查询&nbsp;&nbsp;<input type="radio" name="bystr" value="2"> 内容查询</td>
            </tr>
            <tr align="center">
              <td height="30">
                <input type="submit" name="Action" value=" 查 询 " class="inputbutton">
                &nbsp;&nbsp;&nbsp;
                <input type="reset" name="Clear" value=" 重 写 " class="inputbutton"></td>
            </tr>
            <tr align="center">
              <td height="10"></td>
            </tr>
          </form>
        </table>
        <br></td>
    </tr>
  </tbody>
</table>
<!--#include file = "../Include/Footer.asp"-->
<%
Call Footer()
%>
搜索更多相关主题的帖子: 网站 信息 Request include 上下文 
2013-05-11 13:01
byf19800212
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-5-11
得分:0 
Sub DBConnBegin()
    ' 如果数据库对象已打开,不要再打开
    If IsObject(oConn) = True Then Exit Sub
    Set oConn = Server.CreateObject("ADODB.Connection")

    On Error Resume Next
    ' Access数据库 数据库中已经增加了防止下载的机智!

    oConnStr = "PROVIDER=SQLOLEDB;DATA SOURCE=113.22.120.158;UID=sq_tdlz;PWD=frfdsaeaeegge;DATABASE=sq_tdlz;"
    oConn.Open oConnStr
   
    If Err.Number > 0 Then
        ' 显示错误信息,并且发送邮件通知管理员
        'Call DBConnError(Err)
        
        ' 完全地退出正在运行的脚本
        Response.End
    End If

    ' 创建一个记录集
    Set oRs = Server.CreateObject( "ADODB.Recordset" )
   
    Set reCom = Server.Createobject(")
    reCom.ActiveConnection = oConnStr
    = 4
    = 0
    reCom.Prepared = true
    = "dbo.Sxzx_PagePROC"
End Sub

' ============================================
' 释放数据库连接对象
' ============================================
Sub DBConnEnd()
    On Error Resume Next
    oRs.Close
    Set oRs = Nothing
    oConn.Close
    Set oConn = Nothing
End Sub
2013-05-11 13:14



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




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

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