| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1055 人关注过本帖
标题:Microsoft VBScript 运行时错误 (0x800A01A8)
只看楼主 加入收藏
lai6080
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-8-12
收藏
 问题点数:0 回复次数:3 
Microsoft VBScript 运行时错误 (0x800A01A8)
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: 'Conn'
/Inc/in.asp, 第 118 行


asp源码如下:
<SCRIPT Language="VBScript" runat="server">
dim dbkillSql
'--------定义部份------------------
Dim N_Post,N_Get,N_In,N_Inf,N_Xh,N_db,N_dbstr,Kill_IP,WriteSql
Dim aApplicationValue
If IsArray(Application("Kukoo_config_info"))=False Then Call PutApplicationValue()
aApplicationValue = Application("Kukoo_config_info")

N_In = aApplicationValue(0)
Kill_IP = aApplicationValue(1)
WriteSql = aApplicationValue(2)
alert_url = aApplicationValue(3)
alert_info = aApplicationValue(4)
kill_info = aApplicationValue(5)
N_type = aApplicationValue(6)
Sec_Forms = aApplicationValue(7)
Sec_Form_open = aApplicationValue(8)

Sec_Form = split(Sec_Forms,"|")
N_Inf = split(N_In,"|")

If Kill_IP=1 Then Stop_IP

If Request.Form<>"" Then StopInjection(Request.Form)

If Request.QueryString<>"" Then StopInjection(Request.QueryString)

If Request.Cookies<>"" Then StopInjection(Request.Cookies)
Function Stop_IP()
    Dim Sqlin_IP,rsKill_IP,Kill_IPsql
    Sqlin_IP=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    if Sqlin_IP="" Then Sqlin_IP=Request.ServerVariables("REMOTE_ADDR")
    Kill_IPsql="select Sqlin_IP from SqlIn where Kukoo_SqlIn='"&Sqlin_IP&"' and kill_ip=true"
    Set rsKill_IP=Conn.execute(Kill_IPsql)
    If Not(rsKill_IP.eof or rsKill_IP.bof) Then
        N_Alert(kill_info)
    Response.End
    End If
    rsKill_IP.close    
End Function
Function N_Alert(alert_info)
    Dim str
    str = "<"&"Script Language=JavaScript"&">"
    Select Case N_type
        Case 1
            str = str & "window.opener=null; window.close();"
        Case 2
            str = str & "location.href='"&alert_url&"';"
        Case 3
            str = str & "alert('"&alert_info&"');location.href='"&alert_url&"';"
    end Select
    str = str & "<"&"/Script"&">"
    response.write  str
End Function

Function intype(values)
    Select Case values
        Case Request.Form
            intype = "Post"
        Case Request.QueryString
            intype = "Get"
        Case Request.Cookies
            intype = "Cookies"
    end Select
End Function

Function StopInjection(values)
    For Each N_Get In values
        If values = Request.Form Then
            If Sec_Form_open = 1 Then
                Security_From(values)
            Else
                Select_BadChar(values)
            End If
        Else
            Select_BadChar(values)
        End If
    Next
End Function

Function Select_BadChar(values)
    For N_Xh=0 To Ubound(N_Inf)
        If Instr(LCase(values(N_Get)),N_Inf(N_Xh))<>0 Then
            If WriteSql = 1 Then InsertInfo(values)
            N_Alert(alert_info)
            Response.End
        End If
    Next
End Function

Function Security_From(values)
    For N_i=0 To UBound(Sec_Form)
        response.write N_Get
        If Instr(LCase(N_Get),Sec_Form(N_i))= 0 Then Select_BadChar(values)
    Next
End Function

Function InsertInfo(values)
    Dim ip,url,sql
    ip = Request.ServerVariables("REMOTE_ADDR")
    url = Request.ServerVariables("URL")
    sql = "insert into SqlIn(Sqlin_IP,SqlIn_Web,SqlIn_FS,SqlIn_CS,SqlIn_SJ) values('"&ip&"','"&url&"','"&intype(values)&"','"&N_Get&"','"&N_Replace(values(N_Get))&"')"
    response.write sql
    Conn.Execute(sql)
    Conn.close
    Set Conn = Nothing
End Function

Function N_Replace(N_urlString)
    N_urlString = Replace(N_urlString,"'","''")
    N_urlString = Replace(N_urlString, ">", "&gt;")
    N_urlString = Replace(N_urlString, "<", "&lt;")
    N_Replace = N_urlString
End Function

sub PutApplicationValue()
    dim  infosql,rsinfo
    set rsinfo=conn.execute("select N_In,Kill_IP,WriteSql,alert_url,alert_info,kill_info,N_type,Sec_Forms,Sec_Form_open    from Kukoo_config")
    Redim ApplicationValue(9)
    dim i
    for i=0 to 8
        ApplicationValue(i)=rsinfo(i)
    next
    set rsinfo=nothing
    Application.Lock
    set Application("Kukoo_config_info")=nothing
    Application("Kukoo_config_info")=ApplicationValue
    Application.unlock
end sub
</SCRIPT>
搜索更多相关主题的帖子: 时错误 Microsoft VBScript config Application 
2008-08-12 15:53
lai6080
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-8-12
收藏
得分:0 
红色代码为118行  请高手指教!!谢谢!!
2008-08-12 15:54
realbmw
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2008-8-12
收藏
得分:0 
回复
在前面加一个dim conn
2008-08-12 22:41
sunfishy
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:311
专家分:163
注 册:2007-6-29
收藏
得分:0 
Conn.Execute(sql)
    Conn.close
    Set Conn = Nothing
End Function

Function N_Replace(N_urlString)
    N_urlString = Replace(N_urlString,"'","''")
    N_urlString = Replace(N_urlString, ">", "&gt;")
    N_urlString = Replace(N_urlString, "<", "&lt;")
    N_Replace = N_urlString
End Function

sub PutApplicationValue()
    dim  infosql,rsinfo
    set rsinfo=conn.execute("select N_In,Kill_IP,WriteSql,alert_url,alert_info,kill_info,N_type,Sec_Forms,Sec_Form_open    from Kukoo_config")
    Redim ApplicationValue(9)


上面的conn已经被你关闭了..
2008-08-13 08:49
快速回复:Microsoft VBScript 运行时错误 (0x800A01A8)
数据加载中...
 
   



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

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