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

前端之家收集整理的这篇文章主要介绍了ACCESS数据库的压缩,备份,还原,下载,删除的实现前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="99799" class="copybut" id="copybut99799" onclick="doCopy('code99799')"> 代码如下:

<div class="codebody" id="code99799">


<Metahttp-equiv="Content-Language"content="zh-cn">
<Metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<a href="/tag/shujuku/" target="_blank" class="keywords">数据库</a>管理

<divalign=center>数据库管理系统





<palign="center"> <%
DimZC_DATABASE_PATH
'数据库的路径
ZC_DATABASE_PATH="database/data.mdb"
data_array=Split(ZC_DATABASE_PATH,"/")
Dimaction
action=trim(request("action"))
Dimdbpath,bkfolder,bkdbname,fso,fso1 SelectCaseaction
Case""
Callchushihua()
Case"CompressData"'压缩数据
Dimtmprs
dimallarticle
dimMaxid
dimtopic,username,dateandtime,body
callCompressData()
case"BackupData"'备份数据
ifrequest("act")="Backup"Then
callupdata()
else
callBackupData()
endIf
case"RestoreData"'恢复数据
dimbackpath
ifrequest("act")="Restore"Then
Dbpath=request.form("Dbpath")
backpath=request.form("backpath")
ifdbpath=""Then
response.write"PleaseinputyourdatabasewholeName"
else
Dbpath=server.mappath(Dbpath)
endIf
backpath=server.mappath(backpath) SetFso=server.CreateObject("scripting.filesystemobject")
iffso.fileexists(dbpath)Then
fso.copyfileDbpath,Backpath
response.write"数据库被成功还原!
"
else
response.write"没找到您所需要的数据库!"
endIf
else
callRestoreData()
endIf
Case"SpaceSize"'系统空间占用
callSpaceSize()
Case"deletebackup"
Dimdbname
dbpath=Request.QueryString("dbpath")
dbname=Request.QueryString("dbname")
dbpath=Server.MapPath(dbpath)
dbpath=dbpath&"\"&dbname
setfso=CreateObject("Scripting.FileSystemObject")
Iffso.FileExists(dbPath)Then
fso.DeleteFile(DBPath)
Setfso=nothing
response.write"
您备份的数据库已经"&dbpath&"被成功删除!

<ahref=""data_s.asp"">返回.."
Else
response.writedbpath
response.write"
输入的路径错误,请确认后重新输入!

<ahref=""data_s.asp"">返回.."
EndIf
CaseElse
EndSelect %>

<%
response.write"" Subchushihua()
%>
<divalign=center>
<formid="edit">


<ahref="?action=CompressData">[压缩数据库]


<ahref="?action=BackupData">[备份数据库]


<ahref="?action=RestoreData">[还原数据库]


<ahref="?action=SpaceSize">[系统空间占用]





<%endsub%> <%
'====================系统空间占用=======================
SubSpaceSize()
OnErrorResumeNext
%>
<divalign=center>
<divalign=center>
系统空间查看



<formid="edit">


数据库:<%showSpaceinfo("../"&data_array(1)&"")%>


备份数据库:<%showSpaceinfo("databackup")%>


系统总共:<%showSpaceinfo("/")%>











<ahref="data_s.asp">返回...

<%
EndSub
%>
<%SubShowSpaceInfo(drvpath)
dimfso,d,size,showsize
setfso=server.CreateObject("scripting.filesystemobject")
drvpath=server.mappath(drvpath)
setd=fso.getfolder(drvpath)
size=d.size
showsize=size&"Byte"
ifsize>1024Then
size=(Size/1024)
showsize=size&"KB"
endIf
ifsize>1024Then
size=(size/1024)
showsize=formatnumber(size,2)&"MB"
endIf
ifsize>1024Then
size=(size/1024)
showsize=formatnumber(size,2)&"GB"
endIf
response.write"<fontface=verdana>"&showsize&""
EndSub
%>
<%
SubRestoreData()
%>
<divalign=center>
<divalign=center>

<...

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

猜你在找的MsSQL相关文章