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

📄 data.asp

📁 网人分类信息5.0商业版。非常优秀的分类信息系统。比较少见。
💻 ASP
字号:
<!--#include file="Cook.asp"-->
<%
Call WR.Hand()
Call WR_Content()

Sub WR_Content()
  Dim Currf, Backf, BackFy, DBPath, BoolIs97, Engine, strDBPath
  Call ConnOpen()
  Const JET_3X = 4
  Select Case WR.CheckStr(Request("Action"), 0)
    Case "BackUpOperate"
       Call WRMPS.FsoBegin()
       Currf = Server.MapPath(GatherDB)
       If Fso.FileExists(Currf) = False Then Call WRMPS.ErrView("·原数据库路径不正确<meta http-equiv=RefResh content='1;URL=Data.asp'>",0)
       Backf = "../../DataBackup/"
       BackFy = Replace(WR.CheckStr(Request.Form("BackFy"),0),".","")&".dat"
       If Fso.FoldeRexists(Server.MapPath(Backf)) = False Then Fso.CReateFolder (Server.MapPath(Backf))
       Fso.CopyFile Currf, Server.MapPath(Backf) &"/Gather_"& BackFy
	   Call WRMPS.ErrView("·数据库备份成功<meta http-equiv=RefResh content='1;URL=Data.asp'>",1)
       Call WRMPS.FsoEnd()

    Case "CompactOperate"
       DBPath = "../../DataBackup/Gather_"&Replace(WR.CheckStr(Request.Form("mDBPath"), 0),".","")&".dat"
       BoolIs97 = "false"
       If DBPath <> "" Then
         DBPath = Server.MapPath(DBPath)
         strDBPath = Left(DBPath, InStrRev(DBPath, "\"))
         Call WRMPS.FsoBegin()
         If Fso.FileExists(DBPath) Then
           Set Engine = CReateObject("JRO.JetEngine")
             If BoolIs97 = "true" Then
                Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath, " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;Jet OLEDB:Engine Type=" & JET_3X
             Else
                Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath, " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
             End If
           Fso.CopyFile strDBPath & "temp.mdb", DBPath
           Fso.DeleteFile (strDBPath & "temp.mdb")
           Set Engine = Nothing
		   Call WRMPS.FsoEnd()
		   Call WRMPS.ErrView("·数据库压缩成功<meta http-equiv=RefResh content='1;URL=Data.asp'>",1)
         Else
		   Call WRMPS.FsoEnd()
		   Call WRMPS.ErrView("·数据库名称或路径不正确<meta http-equiv=RefResh content='1;URL=Data.asp'>",0)
         End If
       End If

    Case "RestoReOperate"
       Call WRMPS.FsoBegin()
       Currf = GatherDB
       If InStr(Currf, "*") Then Call WRMPS.ErrView("·数据库路径中包含错误字符<meta http-equiv=RefResh content='1;URL=Data.asp'>",0)
       Currf = Server.MapPath(Currf)
       If Fso.FileExists(Currf) = False Then Call WRMPS.ErrView("·原数据库路径不正确<meta http-equiv=RefResh content='1;URL=Data.asp'>",0)
       Backf = "../../DataBackup/Gather_"&Replace(WR.CheckStr(Request.Form("Backf"), 0),".","")&".dat"
       Backf = Server.MapPath(Backf)
       If Fso.FileExists(Backf) = False Then Call WRMPS.ErrView("·备份数据库路径不正确<meta http-equiv=RefResh content='1;URL=Data.asp'>",0)
       Fso.CopyFile "" & Backf & "", "" & Currf & ""
	   Call WRMPS.FsoEnd()
	   Call WRMPS.ErrView("·数据库恢复成功<meta http-equiv=RefResh content='1;URL=Data.asp'>",1)
    
    Case Else
       Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
       Content = Content & "<tr class=td2><td><a href=Index.asp>系统设置</a> | <a href=Data.asp>数据库管理</a> | <a href=Item.asp?Action=Admit>项目导入</a> | <a href=Item.asp?Action=Export>项目导出</a> | <a href=System_GatheRexe.asp?Action=Timing>定时采集</a></td></tr>" & vbCrLf
       Content = Content & "</table>" & vbCrLf
       Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
       Content = Content & "<form name='form1' method='POST' Action='?Action=BackUpOperate'>" & vbCrLf
       Content = Content & "<tr><td colspan=2 class=td4><strong>备份数据库</strong></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td width='35%'><strong>备份数据库名称</strong></td>" & vbCrLf
       Content = Content & "<td width='65%'><input type='text' name='BackFy' size=20 value='"&Date()&"'></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td></td><td><input type='submit' name='Submit' value=' 备 份 '></td></tr>" & vbCrLf
       Content = Content & "</form>" & vbCrLf
	   
       Content = Content & "<form name='form1' method='POST' Action='?Action=CompactOperate'>" & vbCrLf
       Content = Content & "<tr><td colspan=2 class=td4><strong>压缩数据库</strong></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td><strong>备份数据库名称</strong></td>"
       Content = Content & "<td><input type='text' name='mDBPath' size=20 value='"&Date()&"'></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td></td><td><input type='submit' name='Submit' value=' 压 缩 '></td></tr>" & vbCrLf
       Content = Content & "</form>" & vbCrLf

       Content = Content & "<form name='form1' method='POST' Action='?Action=RestoReOperate'>" & vbCrLf
       Content = Content & "<tr><td colspan=2 class=td4><strong>恢复数据库</strong></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td><strong>备份数据库名称</strong></td>"
       Content = Content & "<td><input type='text' name='Backf' size=20 value='"&Date()&"'></td></tr>" & vbCrLf
       Content = Content & "<tr class=td2><td></td><td><input type='submit' name='Submit' value=' 恢 复 '></td></tr>" & vbCrLf
       Content = Content & "</form>" & vbCrLf
       
       Content = Content & "</table>" & vbCrLf

  End Select
  Response.Write Content
  Call GetBottom()
  Call ClassEnd()
End Sub
%>

⌨️ 快捷键说明

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