ACCESS數(shù)據(jù)庫的壓縮,備份,還原,下載,刪除的實現(xiàn)
更新時間:2006年08月24日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>數(shù)據(jù)庫管理</title>
</head>
<body>
<div align=center>數(shù)據(jù)庫管理系統(tǒng)</div>
<br>
<br>
<p align="center">
<%
Dim ZC_DATABASE_PATH
'數(shù)據(jù)庫的路徑
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" '壓縮數(shù)據(jù)
Dim tmprs
dim allarticle
dim Maxid
dim topic,username,dateandtime,body
call CompressData()
case "BackupData" '備份數(shù)據(jù)
if request("act")="Backup" Then
call updata()
else
call BackupData()
end If
case "RestoreData" '恢復(fù)數(shù)據(jù)
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 "數(shù)據(jù)庫被成功還原!<br>"
else
response.write "沒找到您所需要的數(shù)據(jù)庫!"
end If
else
call RestoreData()
end If
Case "SpaceSize" '系統(tǒng)空間占用
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>您備份的數(shù)據(jù)庫已經(jīng)" & 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">[壓縮數(shù)據(jù)庫]</a>
<br/><br/><a href="?action=BackupData">[備份數(shù)據(jù)庫]</a>
<br/><br/><a href="?action=RestoreData">[還原數(shù)據(jù)庫]</a>
<br/><br/><a href="?action=SpaceSize">[系統(tǒng)空間占用]</a>
<br/><br/>
</form>
</div>
<%end sub%>
<%
'====================系統(tǒng)空間占用=======================
Sub SpaceSize()
On Error Resume Next
%>
<div align=center>
<div align=center>
系統(tǒng)空間查看
<br/><br/>
<form id="edit">
<br>
數(shù)據(jù)庫:<%showSpaceinfo("../"&data_array(1)&"")%><br><br>
備份數(shù)據(jù)庫:<%showSpaceinfo("databackup")%><br><br>
系統(tǒng)總共:<%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/><...
相關(guān)文章
SQLServer 日期函數(shù)大全(小結(jié))
這篇文章主要介紹了SQLServer 日期函數(shù)大全(小結(jié)),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04
SQL?server配置ODBC數(shù)據(jù)源(本地和服務(wù)器)詳細步驟
ODBC是open database connect的縮寫,意思是開放式數(shù)據(jù)庫連接,下面這篇文章主要給大家介紹了關(guān)于SQL?server配置ODBC數(shù)據(jù)源(本地和服務(wù)器)的相關(guān)資料,文中通過圖文介紹的非常詳細,需要的朋友可以參考下2024-07-07
SQL語句練習(xí)實例之六 人事系統(tǒng)中的缺勤(休假)統(tǒng)計
這是一個人事系統(tǒng)中的示例,要求記錄一下員工的缺勤情況2011-10-10
VS2022與SQL?server數(shù)據(jù)庫連接與訪問方法操作
在學(xué)習(xí)過程中我們常常需要連接數(shù)據(jù)庫對大量的數(shù)據(jù)進行管理,下面這篇文章主要給大家介紹了關(guān)于VS2022與SQL?server數(shù)據(jù)庫連接與訪問的相關(guān)資料,文中通過圖文介紹的非常詳細,需要的朋友可以參考下2024-01-01
SqlServer數(shù)據(jù)庫備份與還原的實現(xiàn)步驟
這篇文章主要介紹了SqlServer數(shù)據(jù)庫備份與還原的實現(xiàn)步驟,文中通過示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-03-03
mybatis動態(tài)sql實現(xiàn)邏輯代碼詳解
mybatis通過將sql配置xml文件中,通過解析xml動態(tài)標簽來實現(xiàn)動態(tài)sql,本文以xml文件為例給大家介紹mybatis動態(tài)sql的實現(xiàn)代碼,感興趣的朋友一起看看吧2021-08-08

