ACCESS數(shù)據(jù)庫(kù)的壓縮,備份,還原,下載,刪除的實(shí)現(xiàn)
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>數(shù)據(jù)庫(kù)管理</title>
</head>
<body>
<div align=center>數(shù)據(jù)庫(kù)管理系統(tǒng)</div>
<br>
<br>
<p align="center">
<%
Dim ZC_DATABASE_PATH
'數(shù)據(jù)庫(kù)的路徑
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ù)庫(kù)被成功還原!<br>"
else
response.write "沒(méi)找到您所需要的數(shù)據(jù)庫(kù)!"
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ù)庫(kù)已經(jīng)" & dbpath &"被成功刪除!<br><br><a href=""data_s.asp"">返回..</a>"
Else
response.write dbpath
response.write "<br>輸入的路徑錯(cuò)誤,請(qǐng)確認(rèn)后重新輸入!<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ù)庫(kù)]</a>
<br/><br/><a href="?action=BackupData">[備份數(shù)據(jù)庫(kù)]</a>
<br/><br/><a href="?action=RestoreData">[還原數(shù)據(jù)庫(kù)]</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ù)庫(kù):<%showSpaceinfo("../"&data_array(1)&"")%><br><br>
備份數(shù)據(jù)庫(kù):<%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)文章
如何通過(guò)sysprocesses 簡(jiǎn)單查詢死鎖及解決死鎖最新方案(四步解決)
這篇文章主要介紹了如何通過(guò)sysprocesses 簡(jiǎn)單查詢死鎖及解決死鎖最新方案,本文分四步幫助大家成功解決,需要的朋友可以參考下2024-02-02一些文件未注冊(cè)導(dǎo)致mssql表文件無(wú)法找開(kāi)的解決方法
只需要按下面的步驟注冊(cè)一些文件,即可。2009-09-09SQL語(yǔ)句實(shí)現(xiàn)查詢當(dāng)前數(shù)據(jù)庫(kù)IO等待狀況
這篇文章主要介紹了SQL語(yǔ)句實(shí)現(xiàn)查詢當(dāng)前數(shù)據(jù)庫(kù)IO等待狀況,本文直接給出查詢實(shí)現(xiàn)腳本,需要的朋友可以參考下2015-07-07獲取MSSQL 表結(jié)構(gòu)中字段的備注、主鍵等信息的sql
本文為大家詳細(xì)介紹下如何獲取MSSQL 表結(jié)構(gòu)中字段的備注、主鍵等信息,感興趣的朋友可以參考下2013-09-09查詢表中某字段有重復(fù)記錄個(gè)數(shù)的方法
本篇文章介紹了,查詢表中某字段有重復(fù)記錄個(gè)數(shù)的方法。需要的朋友參考下2013-04-04SQL Server出現(xiàn)System.OutOfMemoryException異常的解決方法
這篇文章主要介紹了SQL Server出現(xiàn)System.OutOfMemoryException異常的解決方法,同時(shí)提供了微軟官方的解決方案,需要的朋友可以參考下2014-06-06SQL中LIKE和REGEXP簡(jiǎn)單對(duì)比分析
這篇文章主要介紹了SQL中LIKE和REGEXP簡(jiǎn)單對(duì)比,在MySQL中,LIKE和REGEXP都可以用于模式匹配,但是它們的語(yǔ)法、性能和應(yīng)用場(chǎng)景有所不同,通常來(lái)說(shuō),在簡(jiǎn)單的字符串模糊匹配場(chǎng)景下,使用LIKE更加高效;而在需要更復(fù)雜的模式匹配時(shí),使用REGEXP更加靈活2023-09-09數(shù)據(jù)庫(kù)備份 SQLServer的備份和災(zāi)難恢復(fù)
數(shù)據(jù)處理在現(xiàn)代企業(yè)運(yùn)營(yíng)中變得越來(lái)越重要,越來(lái)越關(guān)鍵,甚至?xí)蔀槠髽I(yè)發(fā)展的一項(xiàng)瓶頸. 數(shù)據(jù)保護(hù)的重要性也不言而喻. 如果一個(gè)企業(yè)沒(méi)有很好的數(shù)據(jù)保護(hù)方案或策略的話,一旦發(fā)生重要數(shù)據(jù)丟失,后果將會(huì)是災(zāi)難性的,伴隨著會(huì)有經(jīng)濟(jì)利益方面的損失.2010-07-07