标题:我的网页上传到虚拟主机上经常出现:系统升级中。附上代码,请高手帮忙看看 ...
只看楼主
hwanganna
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-3-13
结帖率:0
已结贴  问题点数:20 回复次数:3 
我的网页上传到虚拟主机上经常出现:系统升级中。附上代码,请高手帮忙看看是什么问题。谢谢
我的网页上传到虚拟主机上经常出现:系统升级中。在本机测试是不会出现 系统升级中。请高手帮忙看看是什么问题。谢谢!
数据库连接代码如下:
<%
dim conn,connstr
class db_DataBase
    Public Function exe(byval esql,e)
        if not isobject(conn) then
            'On Error Resume Next
            Set conn = Server.CreateObject("adodb.Connection")
            if conn.state = 0 Then
               
               
                const SqlLocalName = "glb18\sql2005"    '连接IP [ 本地用 (local) 外地用IP ]
                const SqlUserName = "sa"            '用户名
                const SqlPassword = "111111"        '用户密码
                const SqlDatabaseName = "condatabase"     '数据库名
               
               
                connstr = "Provider=Sqloledb; User ID=" & SqlUsername &"; Password="& SqlPassword &"; Initial Catalog = "& SqlDatabaseName &"; Data Source="& SqlLocalName & ";"
                conn.Open connstr
            End if
            if Err Then Err.Clear : Set conn = Nothing : Response.Write "系统升级中..........." : Response.End()
        End if
        select case left(e,1)
            case 1 : Set exe = Server.createobject("adodb.recordset") : exe.open esql,conn,1,1
            case 2 : exe = conn.execute(esql)(0)
            case 3 : Set exe = Server.createobject("adodb.recordset") : exe.open esql,conn,1,3
            case 4 : conn.execute(esql)   
            case 5
                Set rs = conn.execute(esql)
                if not(rs.eof and rs.bof) Then exe = rs.getrows()
                rs.close : set rs = nothing
        End select
    End Function
   
    Public Function close(se)
        if isobject(se) Then if se.state <> 0 Then se.close : set se = nothing
    End Function

    Public Function server_code()
        dim server_v1 : server_v1 = Cstr(Request.ServerVariables("HTTP_REFERER"))
        dim server_v2 : server_v2 = Cstr(Request.ServerVariables("SERVER_NAME"))
        if mid(server_v1,8,len(server_v2)) <> server_v2 Then R.http_referer()
    End Function
End class

class db_write
    Public Function write(byval str)
        Response.write str
    End Function
    Public Function rend(byval str)
        Response.write str
        Response.End()
    End Function
    Public Function http_referer()
        On Error Resume Next
        Response.Redirect Request.ServerVariables("http_referer")
        if Err Then Err.Clear : R.backweb()
    End Function
    Public Function backweb()
        Response.Redirect webpath
        Response.End()
    End Function
    Public Function sVar(byval str)
        sVar = Request.ServerVariables(str)
    End Function
End class

dim db,R  
Set R = new db_write
Set db = new db_DataBase
dim userip '# 提取当前访问用户IP
    userip = R.sVar("http_x_forwarded_for")
 if userip = "" Then userip = R.sVar("remote_addr")
'*******************************************************************************************
'过程名:addDate

'作  用:日期格式
'*******************************************************************************************
Public Function addDate(byval str,byval e)
    if isnull(str) or not isDate(str) Then Exit Function
    select case e
        case 1 : addDate = right("0"& Month(str),2) & "-"& right("0"& day(str),2)
        case 2 : addDate = Year(str) &"-" & right("0"& Month(str),2) &"-" & right("0"& day(str),2)
        case 3 : addDate = Year(str) &"年"& right("0"& Month(str),2) &"月"& right("0"& day(str),2) &"日"
    End select
End Function

'*******************************************************************************************
'过程名:alert

'作  用:提示作用
'*******************************************************************************************
Public Function alert(byval str,byval back) 'Response.Redirect url
    dim Temp
    Select case back
        case -1   : Temp = "window.history.back(-1);"
        case "1"  : Temp = "window.location.href='"& Request.ServerVariables("http_referer") &"';"
        case "2"  : Temp = "window.opener=null;window.close();"
        case "3"  : Temp = "self.location=document.referrer;"
        case else : Temp = "window.location.href='"& back &"';"
    End Select
    Response.write "<script>window.alert('"& str &"');"& Temp &"</script>" : Response.End()
End Function

Public Function req(byval str,byval et)
    Select case left(et,1)  
        case 0 : req = Trim(str)
        case 1
            req = Trim(Request.form(str))
            if req = "" Then req = Trim(Request.querystring(str))
        case 2 : req = Trim(Request.form(str))
        case 3 : req = Trim(Request.querystring(str))
    End Select
    if len(et) = 2 or et = 0 Then
        if len(req) = 0 or not isnumeric(req) Then req = 0 else req = int(req)
    End if
End Function

Public Function money(byval str)
    money = str
    if len(money) = 0 or not isnumeric(money) Then money = 0
    money = formatnumber(money,2,-1,0,0)
End Function
'*******************************************************************************************
'过程名:uncode

'作  用:过滤所有html
'*******************************************************************************************
Public Function uncode(byval word,byval snum)
    if isnull(word) Then Exit Function
    word = replace(replace(replace(word,"&nbsp;"," "),"'","’"),"""","”")
    dim Rp
    Set Rp = new RegExp
    Rp.ignorecase = True
        Rp.global = True
        Rp.pattern = "<.*?>"
        word = Rp.replace(word,"")
        Rp.pattern="\r\n\s*"
        word = Rp.replace(word,"")
        if snum <> 0 Then if len(word) > snum Then word = left(word,snum)+".."
    Set Rp = nothing
    uncode = replace(word,chr(10),"")
End Function
%>
搜索更多相关主题的帖子: 系统升级 虚拟主机 数据库连接 local 
2012-03-13 16:29
hwanganna
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-3-13
得分:0 
补充一下,当出现系统升级中时,按一下F5刷新浏览器又可以正常显示页面
2012-03-13 16:53
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
得分:10 
数据库连接有问题造成的,原因不清楚

----我怎能在别人的苦难面前转过脸去----
2012-03-13 22:22
cnfarer
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:179
帖 子:3330
专家分:21157
注 册:2010-1-19
得分:10 
不会调试吗?!

★★★★★为人民服务★★★★★
2012-03-14 07:18



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




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

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