新建asp備份還原刪除壓縮access數(shù)據(jù)庫(kù)_第1頁(yè)
新建asp備份還原刪除壓縮access數(shù)據(jù)庫(kù)_第2頁(yè)
新建asp備份還原刪除壓縮access數(shù)據(jù)庫(kù)_第3頁(yè)
新建asp備份還原刪除壓縮access數(shù)據(jù)庫(kù)_第4頁(yè)
新建asp備份還原刪除壓縮access數(shù)據(jù)庫(kù)_第5頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、-. z數(shù)據(jù)庫(kù)管理數(shù)據(jù)庫(kù)管理系統(tǒng)%Dim ZC_DATABASE_PATH數(shù)據(jù)庫(kù)的路徑ZC_DATABASE_PATH=database/data.mdbdata_array= Split(ZC_DATABASE_PATH,/)Dim actionaction=trim(request(action)Dim dbpath,bkfolder,bkdbname,fso,fso1Select Case actionCase Call chushihua()Case pressData 壓縮數(shù)據(jù)Dim tmprsdim allarticledim Ma*iddim topic,username,dat

2、eandtime,bodycall pressData()case BackupData 備份數(shù)據(jù)if request(act)=Backup Thencall updata()elsecall BackupData()end Ifcase RestoreData 恢復(fù)數(shù)據(jù)dim backpathif request(act)=Restore ThenDbpath=request.form(Dbpath)backpath=request.form(backpath)if dbpath= Thenresponse.write Please input your database whole Na

3、me elseDbpath=server.mappath(Dbpath)end Ifbackpath=server.mappath(backpath)Set Fso=server.CreateObject(scripting.filesystemobject)if fso.filee*ists(dbpath) Then fso.copyfile Dbpath,Backpathresponse.write 數(shù)據(jù)庫(kù)被成功復(fù)原!elseresponse.write 沒(méi)找到您所需要的數(shù)據(jù)庫(kù)! end Ifelsecall RestoreData()end IfCase SpaceSize 系統(tǒng)空間占用

4、call SpaceSize()Case deletebackupDim dbnamedbpath=Request.QueryString(dbpath)dbname=Request.QueryString(dbname)dbpath=Server.MapPath(dbpath)dbpath=dbpath &dbnameset fso = CreateObject(Scripting.FileSystemObject)If fso.FileE*ists(dbPath) Thenfso.DeleteFile(DBPath)Set fso = nothingresponse.write 您備份的數(shù)

5、據(jù)庫(kù)已經(jīng) & dbpath &被成功刪除!返回.Elseresponse.write dbpath response.write 輸入的路徑錯(cuò)誤,請(qǐng)確認(rèn)后重新輸入!返回.End IfCase ElseEnd Select%response.writeSub chushihua()%壓縮數(shù)據(jù)庫(kù)備份數(shù)據(jù)庫(kù)復(fù)原數(shù)據(jù)庫(kù)系統(tǒng)空間占用系統(tǒng)空間查看數(shù)據(jù)庫(kù):備份數(shù)據(jù)庫(kù):系統(tǒng)總共:返回. 1024 Thensize=(Size/1024)showsize=size & KBend Ifif size1024 Thensize=(size/1024)showsize=formatnumber(size,2) &

6、MB end Ifif size1024 Thensize=(size/1024)showsize=formatnumber(size,2) & GB end If response.write & showsize & End Sub %復(fù)原數(shù)據(jù)庫(kù):復(fù)原的路徑(相對(duì)路徑):input type=te*t size=30 name=DBpath value=DataBackup_Bak.mdb復(fù)原后的路徑(相對(duì)路徑):input type=te*t size=30 name=backpath value=返回.%End SubSub updata()Dbpath=request.form(Db

7、path)Dbpath=server.mappath(Dbpath)bkfolder=request.form(bkfolder)bkdbname=request.form(bkdbname)Set Fso=server.CreateObject(scripting.filesystemobject)if fso.filee*ists(dbpath) ThenIf CheckDir(bkfolder) = True Thenfso.copyfile dbpath,bkfolder& & bkdbnameelseMakeNewsDir bkfolderfso.copyfile dbpath,bk

8、folder& & bkdbnameend Ifresponse.write 已經(jīng)成功備份,你的數(shù)據(jù)庫(kù)的路徑: &bkfolder& & bkdbnameresponse.write 點(diǎn)擊此處將數(shù)據(jù)庫(kù)下載下來(lái): & ZC_BLOG_HOST & request.form(bkfolder) & / & bkdbname &response.write 當(dāng)您下載完畢后,點(diǎn)擊此處將刪除備份的數(shù)據(jù)庫(kù)!返回.Elseresponse.write Error ,找不到文件!End IfSet fso = nothingEnd Sub-檢查*一目錄是否存在-Function CheckDir(Folder

9、Path)folderpath=Server.MapPath(.)&folderpathSet fso1 = CreateObject(Scripting.FileSystemObject)If fso1.FolderE*ists(FolderPath) Then存在CheckDir = TrueElse不存在CheckDir = FalseEnd IfSet fso1 = nothingEnd Function-根據(jù)指定名稱生成目錄-Function MakeNewsDir(foldername)dim fSet fso1 = CreateObject(Scripting.FileSyste

10、mObject)Set f = fso1.CreateFolder(foldername)MakeNewsDir = TrueSet fso1 = nothingEnd FunctionSub BackupData()%備份數(shù)據(jù)庫(kù)當(dāng)前數(shù)據(jù)庫(kù)的路徑(相對(duì)路徑):input type=te*t size=15 name=DBpath value=備份數(shù)據(jù)庫(kù)的路徑(相對(duì)路徑):如果該目錄不存在,系統(tǒng)將自動(dòng)建立備份后數(shù)據(jù)庫(kù)的名稱:input type=te*t size=20 name=bkDBname value=_bak.mdb 按日期自動(dòng)命名如果備份文件不存在將建立,如果存在,將自動(dòng)覆蓋!返回.

11、壓縮數(shù)據(jù)庫(kù):輸入數(shù)據(jù)庫(kù)的所在路徑壓縮數(shù)據(jù)庫(kù)的路徑:input type=te*t name=dbpath value=如果是ac97,請(qǐng)將鉤打上.(默認(rèn)是Access 2000)返回.%Dim dbpath,boolIs97dbpath = request(dbpath)boolIs97 = request(boolIs97)If dbpath Thendbpath = server.mappath(dbpath)response.write(pactDB(dbpath,boolIs97)End IfEnd Sub=壓縮參數(shù)=Function pactDB(dbPath, boolIs97)D

12、im fso, Engine, strDBPath,JET_3*strDBPath = Left(dbPath,InStrRev(DBPath,)Set fso = CreateObject(Scripting.FileSystemObject)If fso.FileE*ists(dbPath) Thenfso.CopyFile dbpath,strDBPath & temp.mdbSet Engine = CreateObject(JRO.JetEngine)If boolIs97 = True ThenEngine.pactDatabase Provider=Microsoft.Jet.O

13、LEDB.4.0;Data Source= & strDBPath & temp.mdb, _Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & strDBPath & temp1.mdb; _& Jet OLEDB:Engine Type= & JET_3*ElseEngine.pactDatabase Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & strDBPath & temp.mdb, _Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & strDBPath & temp1.mdbEnd Iffso.CopyFile strDBPath & temp1.mdb,dbpathfso.Dele

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論