- <!--#include file="config.asp" -->
- <!--#include file="Fun.asp" -->
- <%
- '数据库管理类
- 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('成功:你已经成功恢复数据库!');window.location.href='DataManage.asp?action=rt'
- // --></script>")
- else
- response.Write("<script language=javascript><!--
- alert('失败:请检查路径和数据库名是否存在');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('成功:数据库已经压缩成功!');window.location.href='DataManage.asp?action=dc'
- // --></script>")
- else
- response.Write("<script language=javascript><!--
- alert('失败:数据库压缩失败,请检查路径和数据库名是否存在!');window.location.href='DataManage.asp?action=dc'
- // --></script>")
- end if
- end sub
- end class
- %>
asp Access数据备份,还原,压缩类代码
2019-09-07 15:13脚本之家 ASP教程
asp Access数据备份,还原,压缩类实现代码,大家可以参考下。
延伸 · 阅读
- 2022-02-23Excel2003表格中如何导入ACCESS数据库实现数据快速
- 2022-02-22C# 操作 access 数据库的实例代码
- 2022-02-10c# 使用Entity Framework操作Access数据库的示例
- 2022-01-17C#如何将Access中以时间段条件查询的数据添加到
- 2021-12-27C#实现Access通用访问类OleDbHelper完整实例
- 2021-12-26如何让Windows 64位系统支持Access数据库?
精彩推荐
- ASP教程
字符批量替换程序asp服务器版
字符批量替换程序asp服务器版,安装方法:直接把replace.asp文件放在任意的支持asp+FSO的环境中 ...
- ASP教程
ASP实现文件上传的方法
在基于浏览器/服务器的应用环境中,在浏览器中上传各种类型的文件一直是困扰用户文件管理应用的难题之一。常用的实现方法是利用在RFC1867中引入的一...
- ASP教程
asp读取远程文件并保存到本地代码
asp读取远程文件并保存到本地代码 ...
- ASP教程
asp中一段防SQL注入的通用脚本
asp中一段防SQL注入的通用脚本...
- ASP教程
asp删除mssql数据库中没有记录的图片代码
asp删除没有记录的图片需要文件夹(存放图片的文件夹)中的每个图片和数据库中的所有记录进行比较...
- ASP教程
ASP GetRef 函数指针试探
近日在学习C++,看到函数指针,由于之前一直搞ASP,所以想ASP里面是否也有这个函数指针的东西,百度了一下,没有太多关于此方面的介绍,于是翻了翻...
- ASP教程
ASP常用函数:HTMLDecode
ASP常用函数:HTMLDecode ...
- ASP教程
ASP 判断是否有中文的代码
其实我上一篇写的js判断中文才是最好的方法,这个是asp的一种,只要是双字节都是当作中文判断...