ACCESS数据库的压缩,备份,还原,下载,删除的实现
时间:2024-01-18 16:16:26
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数据库管理</title>
</head>
<body>
<div align=center>数据库管理系统</div>
<br>
<br>
<p align="center">
<%
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 "数据库被成功还原!<br>"
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 "<br>您备份的数据库已经" & dbpath &"被成功删除!<br><br><a href=""data_s.asp"">返回..</a>"
Else
response.write dbpath
response.write "<br>输入的路径错误,请确认后重新输入!<br><br><a href=""data_s.asp"">返回..</a>"
End If
Case Else
End Select
%>
</div>
<%
response.write"</body></html>"
Sub chushihua()
%>
<div align=center>
<form id="edit">
<br/>
<a href="?action=CompressData">[压缩数据库]</a>
<br/><br/><a href="?action=BackupData">[备份数据库]</a>
<br/><br/><a href="?action=RestoreData">[还原数据库]</a>
<br/><br/><a href="?action=SpaceSize">[系统空间占用]</a>
<br/><br/>
</form>
</div>
<%end sub%>
<%
'====================系统空间占用=======================
Sub SpaceSize()
On Error Resume Next
%>
<div align=center>
<div align=center>
系统空间查看
<br/><br/>
<form id="edit">
<br>
数据库:<%showSpaceinfo("../"&data_array(1)&"")%><br><br>
备份数据库:<%showSpaceinfo("databackup")%><br><br>
系统总共:<%showSpaceinfo("/")%>
<br><br>
</form>
</div>
<br >
<br >
<br >
<a href="data_s.asp">返回...</a>
</div>
<%
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 "<font face=verdana>" & showsize & "</font>"
End Sub
%>
<%
Sub RestoreData()
%>
<div align=center>
<div align=center>
<br/><...
标签:ACCESS数据库的压缩,备份,还原,下载,删除的实现
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
在js中的replace方法详解
2007-08-21 15:47:00
python用moviepy对视频进行简单的处理
2023-08-03 07:02:15
![](https://img.aspxhome.com/file/2023/8/60518_0s.png)
pytest-sugar 执行过程中显示进度条的脚本分享
2023-01-26 13:20:40
Python模板的使用详细讲解
2022-03-20 13:24:08
![](https://img.aspxhome.com/file/2023/7/103237_0s.png)
MySQL基于GTID主从搭建
2024-01-23 18:17:56
Javascript Closures (2)
2009-03-18 12:22:00
JS字符串拼接的几种方式(最新推荐)
2024-04-10 16:11:41
MySQL Packet for query is too large 问题及解决方法
2024-01-29 07:55:52
keras多显卡训练方式
2022-05-01 02:50:21
详解python3百度指数抓取实例
2022-01-11 03:06:59
![](https://img.aspxhome.com/file/2023/2/102802_0s.png)
网站中视觉元素的设计
2008-04-27 20:47:00
![](https://img.aspxhome.com/file/UploadPic/20084/27/2008427204953291s.jpg)
Google的用户体验设计原则
2009-01-12 18:31:00
vue简单的二维数组循环嵌套方式
2024-04-27 16:09:56
![](https://img.aspxhome.com/file/2023/1/132971_0s.png)
SQL注入防御:用三种策略应对SQL注入攻击
2008-12-15 16:31:00
Python 提取dict转换为xml/json/table并输出的实现代码
2021-01-26 17:56:17
layabox2.0命令行在vscode中编译打包问题
2022-08-27 02:23:20
Django用户认证系统如何实现自定义
2021-02-03 07:54:38
python实现Dijkstra静态寻路算法
2021-06-10 07:41:09
![](https://img.aspxhome.com/file/2023/1/97731_0s.jpg)
Python3将jpg转为pdf文件的方法示例
2021-06-25 11:31:17
python追加元素到列表的方法
2023-07-08 14:29:47