- <!--#include file="config.asp" -->
- <!--#include file="Fun.asp" -->
- <%
- '數(shù)據(jù)庫管理類
- class Datas
- '備份
- public sub Bk()
- Set fso=server.createobject("scripting.filesystemobject")
- fso.CopyFile Server.MapPath(SiteDataPath),Server.MapPath(SiteDataBakPath)
- set fso=nothing
- response.Write("<script language=javascript><!--
- alert('備份成功!');window.location.href='DataManage.asp'
- // --></script>")
- end sub
- '還原
- public sub Rt()
- SDPath = server.mappath(SiteDataPath)
- SDBPath = server.mappath(SiteDataBakPath)
- set Fso=Server.CreateObject("Scripting.FileSystemObject")
- if Fso.FileExists(SDBPath) then
- Fso.CopyFile SDBPath,SDPath
- Set Fso=nothing
- response.Write("<script language=javascript><!--
- alert('成功:你已經(jīng)成功恢復(fù)數(shù)據(jù)庫!');window.location.href='DataManage.asp?action=rt'
- // --></script>")
- else
- response.Write("<script language=javascript><!--
- alert('失敗:請檢查路徑和數(shù)據(jù)庫名是否存在');window.location.href='DataManage.asp?action=rt'
- // --></script>")
- end if
- end sub
- '壓縮
- public sub Dc()
- SDBPath = server.mappath(SiteDataBakPath)
- set Fso=Server.CreateObject("Scripting.FileSystemObject")
- if Fso.FileExists(SDBPath) then
- Set Engine =Server.CreateObject("JRO.JetEngine")
- if request("boolIs") = "97" then
- Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
- "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb;" _
- & "Jet OLEDB:Engine Type=" & JET_3X
- else
- Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath, _
- "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SDBPath & "_temp.mdb"
- end if
- Fso.CopyFile SDBPath & "_temp.mdb",SDBPath
- Fso.DeleteFile(SDBPath & "_temp.mdb")
- set Fso = nothing
- set Engine = nothing
- response.Write("<script language=javascript><!--
- alert('成功:數(shù)據(jù)庫已經(jīng)壓縮成功!');window.location.href='DataManage.asp?action=dc'
- // --></script>")
- else
- response.Write("<script language=javascript><!--
- alert('失敗:數(shù)據(jù)庫壓縮失敗,請檢查路徑和數(shù)據(jù)庫名是否存在!');window.location.href='DataManage.asp?action=dc'
- // --></script>")
- end if
- end sub
- end class
- %>
asp Access數(shù)據(jù)備份,還原,壓縮類代碼
2019-09-07 15:13腳本之家 ASP教程
asp Access數(shù)據(jù)備份,還原,壓縮類實(shí)現(xiàn)代碼,大家可以參考下。
延伸 · 閱讀
- 2022-02-23Excel2003表格中如何導(dǎo)入ACCESS數(shù)據(jù)庫實(shí)現(xiàn)數(shù)據(jù)快速
- 2022-02-22C# 操作 access 數(shù)據(jù)庫的實(shí)例代碼
- 2022-02-10c# 使用Entity Framework操作Access數(shù)據(jù)庫的示例
- 2022-01-17C#如何將Access中以時間段條件查詢的數(shù)據(jù)添加到
- 2021-12-27C#實(shí)現(xiàn)Access通用訪問類OleDbHelper完整實(shí)例
- 2021-12-26如何讓W(xué)indows 64位系統(tǒng)支持Access數(shù)據(jù)庫?
- ASP教程
ASP常用函數(shù):getpy()
ASP常用函數(shù):getpy()...
- ASP教程
ASP.NET 數(shù)據(jù)源
數(shù)據(jù)源 一個 data sourse 控件與數(shù)據(jù)綁定的控件相互作用,并隱藏了復(fù)雜的數(shù)據(jù)的聯(lián)編過程。這些是提供數(shù)據(jù)給 data bound 控件的工具,并且支持如插入,刪除...
- ASP教程
JScript中遍歷Request表單參數(shù)集合的方法
這篇文章主要介紹了JScript中遍歷Request表單參數(shù)集合的方法,本文以遍歷Request.QueryString集合為例給出了實(shí)現(xiàn)代碼,需要的朋友可以參考下...
- ASP教程
asp 標(biāo)記字符串中指定字符變色不區(qū)分大小寫
今天遇到這種問題,單純的使用replace函數(shù)不行,他會改變原有的字符串的大小寫,在網(wǎng)上找到相關(guān)的代碼,自己備份下...
- ASP教程
asp+javascript實(shí)現(xiàn)404頁的處理轉(zhuǎn)換
asp+javascript實(shí)現(xiàn)404頁的處理轉(zhuǎn)換...
- ASP教程
asp之基于adodb.stream的文件操作類
asp之基于adodb.stream的文件操作類...
- ASP教程
asp 采集實(shí)戰(zhàn)代碼
最近實(shí)在是太流行采集了,本人是不喜歡采集的,但對采集的原理我卻很有興趣進(jìn)行研究,拿到了網(wǎng)上采集常用函數(shù),對其進(jìn)行了一番研究,并實(shí)戰(zhàn),結(jié)果...
- ASP教程
asp Access數(shù)據(jù)備份,還原,壓縮類代碼
asp Access數(shù)據(jù)備份,還原,壓縮類實(shí)現(xiàn)代碼,大家可以參考下。...