系统空间查看 返回... 1024">
当前位置:Gxlcms > mysql > ACCESS数据库的压缩,备份,还原,下载,删除的实现

ACCESS数据库的压缩,备份,还原,下载,删除的实现

时间:2021-07-01 10:21:17 帮助过:22人阅读

ACCESS数据库的压缩,备份,还原,下载,删除的实现

代码如下:




数据库管理



数据库管理系统







<%
Dim ZC_DATABASE_PATH
'数据库的路径
ZC_DATABASE_PATH="database/data.mdb"


data_array= Split(ZC_DATABASE_PATH,"/")


Dim action
action=trim(request("action"))
Dim dbpath,bkfolder,bkdbname,fso,fso1

Select Case action
Case ""
Call chushihua()
Case "CompressData" '压缩数据
Dim tmprs
dim allarticle
dim Maxid
dim topic,username,dateandtime,body
call CompressData()
case "BackupData" '备份数据
if request("act")="Backup" Then
call updata()
else
call BackupData()
end If
case "RestoreData" '恢复数据
dim backpath
if request("act")="Restore" Then
Dbpath=request.form("Dbpath")
backpath=request.form("backpath")
if dbpath="" Then
response.write "Please input your database whole Name"
else
Dbpath=server.mappath(Dbpath)
end If
backpath=server.mappath(backpath)

Set Fso=server.CreateObject("scripting.filesystemobject")
if fso.fileexists(dbpath) Then
fso.copyfile Dbpath,Backpath
response.write "数据库被成功还原!
"
else
response.write "没找到您所需要的数据库!"
end If
else
call RestoreData()
end If
Case "SpaceSize" '系统空间占用
call SpaceSize()
Case "deletebackup"
Dim dbname
dbpath=Request.QueryString("dbpath")
dbname=Request.QueryString("dbname")
dbpath=Server.MapPath(dbpath)
dbpath=dbpath &"\"&dbname
set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
fso.DeleteFile(DBPath)
Set fso = nothing
response.write "
您备份的数据库已经" & dbpath &"被成功删除!

返回.."
Else
response.write dbpath
response.write "
输入的路径错误,请确认后重新输入!

返回.."
End If
Case Else
End Select

%>


<%
response.write""

Sub chushihua()
%>



<%end sub%>

<%
'====================系统空间占用=======================
Sub SpaceSize()
On Error Resume Next
%>


系统空间查看











返回...

<%
End Sub
%>
<% Sub ShowSpaceInfo(drvpath)
dim fso,d,size,showsize
set fso=server.CreateObject("scripting.filesystemobject")
drvpath=server.mappath(drvpath)
set d=fso.getfolder(drvpath)
size=d.size
showsize=size & " Byte"
if size>1024 Then
size=(Size/1024)
showsize=size & " KB"
end If
if size>1024 Then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end If
if size>1024 Then
size=(size/1024)
showsize=formatnumber(size,2) & " GB"
end If
response.write "" & showsize & ""
End Sub
%>
<%
Sub RestoreData()
%>

人气教程排行