当前位置: 首页 > news >正文 asp Access数据备份,还原,压缩类 news 来源:原创 2024/5/10 1:19:00 <!--#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("<mce:script language=javascript><!-- alert('备份成功!');window.location.href='DataManage.asp' // --></mce: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("<mce:script language=javascript><!-- alert('成功:你已经成功恢复数据库!');window.location.href='DataManage.asp?action=rt' // --></mce:script>") else response.Write("<mce:script language=javascript><!-- alert('失败:请检查路径和数据库名是否存在');window.location.href='DataManage.asp?action=rt' // --></mce: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("<mce:script language=javascript><!-- alert('成功:数据库已经压缩成功!');window.location.href='DataManage.asp?action=dc' // --></mce:script>") else response.Write("<mce:script language=javascript><!-- alert('失败:数据库压缩失败,请检查路径和数据库名是否存在!');window.location.href='DataManage.asp?action=dc' // --></mce:script>") end if end sub end class %> 相关文章: js 鼠标移动显示图片 AJAX类 JS动态添加与删除select中的Option对象 IIS常见问题解决 asp or 漏洞 MySQL常用命令一览 MYSQL出错代码列表一览 MySQL修改密码方法总结 在b/s开发中经常用到的javaScript技术整理 asp 购物车类 用js改变css样式 js设置控件的readonly和enabled属性问题 sql内置函数 sql CHARINDEX JS去空格 JS 中的深拷贝与浅拷贝 [译] React v16.8: 含有Hooks的版本 【EOS】Cleos基础 Android 架构优化~MVP 架构改造 es6 gops —— Go 程序诊断分析工具 Java IO学习笔记一 js面向对象 JS正则表达式精简教程(JavaScript RegExp 对象) Python socket服务器端、客户端传送信息 SpiderData 2019年2月25日 DApp数据排行榜 VuePress 静态网站生成 vue和cordova项目整合打包,并实现vue调用android的相机的demo vue自定义指令实现v-tap插件 Zsh 开发指南(第十四篇 文件读写) 阿里云前端周刊 - 第 26 期 闭包--闭包之tab栏切换(四) 初识 beanstalkd 从@property说起(二)当我们写下@property (nonatomic, weak) id obj时,我们究竟写了什么... 动手做个聊天室,前端工程师百无聊赖的人生 回顾 Swift 多平台移植进度 #2 爬虫进阶 -- 神级程序员:让你的爬虫就像人类的用户行为! 使用SAX解析XML 一套莫尔斯电报听写、翻译系统 在Docker Swarm上部署Apache Storm:第1部分 #微信小程序:微信小程序常见的配置传值 $L^p$ 调和函数恒为零 (04)Hive的相关概念——order by 、sort by、distribute by 、cluster by (ISPRS,2023)深度语义-视觉对齐用于zero-shot遥感图像场景分类 (Matlab)遗传算法优化的BP神经网络实现回归预测 (Mirage系列之二)VMware Horizon Mirage的经典用户用例及真实案例分析 (poj1.3.2)1791(构造法模拟) (zhuan) 一些RL的文献(及笔记) (阿里巴巴 dubbo,有数据库,可执行 )dubbo zookeeper spring demo (附源码)ssm码农论坛 毕业设计 231126 (转)平衡树 (转)视频码率,帧率和分辨率的联系与区别 .bat文件调用java类的main方法 .NET MAUI学习笔记——2.构建第一个程序_初级篇 .Net组件程序设计之线程、并发管理(一)
<!--#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("<mce:script language=javascript><!-- alert('备份成功!');window.location.href='DataManage.asp' // --></mce: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("<mce:script language=javascript><!-- alert('成功:你已经成功恢复数据库!');window.location.href='DataManage.asp?action=rt' // --></mce:script>") else response.Write("<mce:script language=javascript><!-- alert('失败:请检查路径和数据库名是否存在');window.location.href='DataManage.asp?action=rt' // --></mce: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("<mce:script language=javascript><!-- alert('成功:数据库已经压缩成功!');window.location.href='DataManage.asp?action=dc' // --></mce:script>") else response.Write("<mce:script language=javascript><!-- alert('失败:数据库压缩失败,请检查路径和数据库名是否存在!');window.location.href='DataManage.asp?action=dc' // --></mce:script>") end if end sub end class %>