⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pe2005_datatrans.asp

📁 《动易网站管理系统》2005 SP2正式版中
💻 ASP
📖 第 1 页 / 共 5 页
字号:
    Source_Type = Trim(request("Source_Type"))
    If Source_Type = "ACCESS" Then
        Source_AC = Trim(request("Source_AC"))
        If Source_AC = "" Then
            Response.Write "请输入源数据库文件名!"
            chkdatabase = False
            Exit Function
        End If
        Set Conn_Source = Server.CreateObject("ADODB.Connection")
        Conn_Source.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("" & Source_AC & "")
        If Err.Number <> 0 Then
            Response.Write "数据库连接错误,请确认输入的源数据库路径和文件名是否正确。"
            chkdatabase = False
            Exit Function
        End If
        chkdatabase = True
    ElseIf Source_Type = "SQL" Then
        Source_SQL = Trim(request("Source_SQL"))
        If Source_SQL = "" Then
            Response.Write "请输入源数据库连接字符串!"
            chkdatabase = False
            Exit Function
        End If
        Set Conn_Source = Server.CreateObject("ADODB.Connection")
        Conn_Source.open Source_SQL
        If Err.Number <> 0 Then
            Response.Write "数据库连接错误,请确认输入的源数据库连接字符串是否正确,特别是数据库服务器的IP地址。"
            chkdatabase = False
            Exit Function
        End If
        chkdatabase = True
    End If
    Remote_Type = Trim(request("Remote_Type"))
    If Remote_Type = "ACCESS" Then
        Remote_AC = Trim(request("Remote_AC"))
        If Remote_AC = "" Then
            Response.Write "请输入目标数据库文件名!"
            chkdatabase = False
            Exit Function
        End If
        Set Conn_Remote = Server.CreateObject("ADODB.Connection")
        Conn_Remote.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("" & Remote_AC & "")
        If Err.Number <> 0 Then
            Response.Write "数据库连接错误,请确认输入的目标数据库文件名和路径是否正确。"
            chkdatabase = False
            Exit Function
        End If
        chkdatabase = True
    ElseIf Remote_Type = "SQL" Then
        Remote_SQL = Trim(request("Remote_SQL"))
        If Remote_SQL = "" Then
            Response.Write "请输入目标数据库连接字符串!"
            chkdatabase = False
            Exit Function
        End If
        Set Conn_Remote = Server.CreateObject("ADODB.Connection")
        Conn_Remote.open Remote_SQL
        If Err.Number <> 0 Then
            Response.Write "数据库连接错误,请确认输入的目标数据库连接字符串是否正确,特别是数据库服务器的IP地址。"
            chkdatabase = False
            Exit Function
        End If
        chkdatabase = True
    End If
    If chkdatabase Then
        If Remote_Type = Source_Type Then
            If Remote_Type = "ACCESS" And Source_Type = "ACCESS" And Remote_AC = Source_AC Then
                Response.Write "不能对从一个数据库迁移/复制数据到它本身。"
                chkdatabase = False
                Exit Function
            ElseIf Remote_Type = "SQL" And Source_Type = "SQL" And Remote_SQL = Source_SQL Then
                Response.Write "不能从一个数据库迁移/复制数据到它本身。"
                chkdatabase = False
                Exit Function
            End If
        End If
    End If
End Function

Sub Update()
    BeginTime = Timer
    If chkdatabase() = False Then Exit Sub
    
    UpdateTable = Trim(request("UpdateTable"))
    If UpdateTable <> "" Then Call InitPercentBar
    
    Call Update_PE_Field

    If InStr(UpdateTable, "PE_Admin") > 0 Then
        Call Update_PE_Admin
    End If
    If InStr(UpdateTable, "PE_Config") > 0 Then
        Call Update_PE_Config
    End If
    If InStr(UpdateTable, "PE_Skin") > 0 Then
        Call Update_PE_Skin
    End If
    If InStr(UpdateTable, "PE_Template") > 0 Then
        Call Update_PE_Template
    End If
    If InStr(UpdateTable, "PE_Channel") > 0 Then
        Call Update_PE_Channel
    End If
    If InStr(UpdateTable, "PE_Class") > 0 Then
        Call Update_PE_Class
    End If

    If InStr(UpdateTable, "PE_Article") > 0 Then
        Call Update_PE_Article
    End If
    If InStr(UpdateTable, "PE_Soft") > 0 Then
        Call Update_PE_Soft
    End If
    If InStr(UpdateTable, "PE_Photo") > 0 Then
        Call Update_PE_Photo
    End If
    If InStr(UpdateTable, "PE_Special") > 0 Then
        Call Update_PE_Special
    End If
    If InStr(UpdateTable, "PE_JsFile") > 0 Then
        Call Update_PE_JsFile
    End If
    If InStr(UpdateTable, "PE_Comment") > 0 Then
        Call Update_PE_Comment
    End If
    
    If InStr(UpdateTable, "PE_Advertisement") > 0 Then
        Call Update_PE_Advertisement
    End If
    If InStr(UpdateTable, "PE_AdZone") > 0 Then
        Call Update_PE_AdZone
    End If
    If InStr(UpdateTable, "PE_Announce") > 0 Then
        Call Update_PE_Announce
    End If
    If InStr(UpdateTable, "PE_Author") > 0 Then
        Call Update_PE_Author
    End If
    If InStr(UpdateTable, "PE_Card") > 0 Then
        Call Update_PE_Card
    End If
    If InStr(UpdateTable, "PE_Classroom") > 0 Then
        Call Update_PE_Classroom
    End If

    If InStr(UpdateTable, "PE_CopyFrom") > 0 Then
        Call Update_PE_CopyFrom
    End If
    If InStr(UpdateTable, "PE_Equipment") > 0 Then
        Call Update_PE_Equipment
    End If
    If InStr(UpdateTable, "PE_Favorite") > 0 Then
        Call Update_PE_Favorite
    End If
    Call Refresh_PE_Field
    If InStr(UpdateTable, "PE_Filters") > 0 Then
        Call Update_PE_Filters
    End If
    If InStr(UpdateTable, "PE_FriendSite") > 0 Then
        Call Update_PE_FriendSite
    End If

    If InStr(UpdateTable, "PE_FSKind") > 0 Then
        Call Update_PE_FSKind
    End If
    If InStr(UpdateTable, "PE_GuestBook") > 0 Then
        Call Update_PE_GuestBook
    End If
    If InStr(UpdateTable, "PE_GuestKind") > 0 Then
        Call Update_PE_GuestKind
    End If
    If InStr(UpdateTable, "PE_HistrolyNews") > 0 Then
        Call Update_PE_HistrolyNews
    End If
    If InStr(UpdateTable, "PE_Item") > 0 Then
        Call Update_PE_Item
    End If
    If InStr(UpdateTable, "PE_KeyLink") > 0 Then
        Call Update_PE_KeyLink
    End If

    If InStr(UpdateTable, "PE_Label") > 0 Then
        Call Update_PE_Label
    End If
    If InStr(UpdateTable, "PE_Log") > 0 Then
        Call Update_PE_Log
    End If
    If InStr(UpdateTable, "PE_Message") > 0 Then
        Call Update_PE_Message
    End If
    If InStr(UpdateTable, "PE_NewKeys") > 0 Then
        Call Update_PE_NewKeys
    End If
    If InStr(UpdateTable, "PE_UsedDetail") > 0 Then
        Call Update_PE_UsedDetail
    End If
    If InStr(UpdateTable, "PE_Vote") > 0 Then
        Call Update_PE_Vote
    End If

    If InStr(UpdateTable, "PE_Bank") > 0 Then
        Call Update_PE_Bank
    End If
    If InStr(UpdateTable, "PE_BankrollItem") > 0 Then
        Call Update_PE_BankrollItem
    End If
    If InStr(UpdateTable, "PE_ConsumeLog") > 0 Then
        Call Update_PE_ConsumeLog
    End If
    If InStr(UpdateTable, "PE_DeliverItem") > 0 Then
        Call Update_PE_DeliverItem
    End If
    If InStr(UpdateTable, "PE_DeliverType") > 0 Then
        Call Update_PE_DeliverType
    End If
    If InStr(UpdateTable, "PE_OrderForm") > 0 Then
        Call Update_PE_OrderForm
    End If

    If InStr(UpdateTable, "PE_OrderFormItem") > 0 Then
        Call Update_PE_OrderFormItem
    End If
    If InStr(UpdateTable, "PE_Payment") > 0 Then
        Call Update_PE_Payment
    End If
    If InStr(UpdateTable, "PE_PaymentType") > 0 Then
        Call Update_PE_PaymentType
    End If
    If InStr(UpdateTable, "PE_PresentProject") > 0 Then
        Call Update_PE_PresentProject
    End If
    If InStr(UpdateTable, "PE_Producer") > 0 Then
        Call Update_PE_Producer
    End If
    If InStr(UpdateTable, "PE_Product") > 0 Then
        Call Update_PE_Product
    End If

    If InStr(UpdateTable, "PE_Trademark") > 0 Then
        Call Update_PE_Trademark
    End If
    If InStr(UpdateTable, "PE_TransferItem") > 0 Then
        Call Update_PE_TransferItem
    End If
    If InStr(UpdateTable, "PE_User") > 0 Then
        Call Update_PE_User
    End If
    If InStr(UpdateTable, "PE_UserGroup") > 0 Then
        Call Update_PE_UserGroup
    End If
    Call DelAllCache

    Response.Write "<script>" & vbCrLf
    Response.Write "Info_CurrentUpdate.innerHTML=""<font color='blue'>数据库升级成功!</font>"";" & vbCrLf
    Response.Write "</script>" & vbCrLf

    Conn_Source.Close
    Set Conn_Source = Nothing
    Conn_Remote.Close
    Set Conn_Remote = Nothing
    EndTime = Timer
    Call Success

End Sub

Sub Success()
    Response.Write "<br><br>恭喜您,从动易2005" & Session("arrPETrans")(1) & "版数据库升级到" & Session("arrPETrans")(4) & "版数据库成功!!!<br>"
    Response.Write "共耗时:" & FormatNumber((EndTime - BeginTime) * 1000, 2) & "毫秒。<br>"
    Response.Write "<font color=red>若您是直接在服务器进行升级,则请立即删除此文件!以免带来安全隐患。</font><br><br>"
    Response.Write "升级成功后,请到后台管理<font color='#FF0000'>认真仔细的</font>检查相关数据。<br>" & vbCrLf
    Response.Write "<p align='center'><input type='button' name='close' value=' 关闭此窗口 ' onclick='javascript:onclick=window.close()'></p>"
End Sub

Sub Update_PE_Admin()
    Info_CurrentUpdate = "正在升级网站管理员..."
    TableName = "PE_Admin"
    RecordNum = GetRecordNum(TableName)
    RecordIndex = 0
    Dim rsAdmin2, rsAdmin
    Set rsAdmin2 = Server.CreateObject("ADODB.Recordset")
    Set rsAdmin = Server.CreateObject("ADODB.Recordset")
    rsAdmin2.open "select * from PE_Admin Order by ID Asc", Conn_Source, 1, 1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -