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">
数据库管理 <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 %>