数据库备份与恢复.doc
《数据库备份与恢复.doc》由会员分享,可在线阅读,更多相关《数据库备份与恢复.doc(13页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、数据库备份与恢复.txt我是天使,回不去天堂是因为体重的原因。别人装处,我只好装经验丰富。泡妞就像挂QQ,每天哄她2个小时,很快就可以太阳了。access,备份和恢复,完整,可用 % db=./xs_data/xs.mdb If Request.QueryString(action)=back Then currf=request.form(currf) currf=server.mappath(currf) backf=request.form(backf) backf=server.mappath(backf) backfy=request.form(backfy) On error re
2、sume next Set objfso = Server.CreateObject(Scripting.FileSystemObject) if err then err.clear response.write alert(不能建立fso对象,请确保你的空间支持fso:!);history.back(); response.end end if if objfso.Folderexists(backf) = false then Set fy=objfso.CreateFolder(backf) end if objfso.copyfile currf,backf& & backfy re
3、sponse.write alert(备份数据库成功);history.back(); End If If Request.QueryString(action)=ys Then currf=request.form(currf) currf = server.mappath(currf) ys=request.form(ys) Const JET_3X = 4 strDBPath = left(currf,instrrev(currf,) on error resume next Set objfso = Server.CreateObject(Scripting.FileSystemObj
4、ect) if err then err.clear response.write alert(不能建立fso对象,请确保你的空间支持fso:!);history.back(); response.end end if if objfso.fileexists(currf) then Set Engine = CreateObject(JRO.JetEngine) response.write strDBPath on error resume next If ys = 1 Then Engine.CompactDatabase Provider=Microsoft.Jet.OLEDB.4.0
5、;Data Source= & currf, _ Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & strDBPath & tourtemp.mdb; _ & Jet OLEDB:Engine Type= & JET_3X Else Engine.CompactDatabase Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & currf, _ Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & strDBPath & tourtemp.mdb End If
6、objfso.CopyFile strDBPath & tourtemp.mdb,currf objfso.DeleteFile(strDBPath & tourtemp.mdb) Set objfso = nothing Set Engine = nothing if err then err.clear response.write alert(错误:&err.description&);history.back(); response.end end if response.write alert(压缩数据库成功);history.back(); response.end Else re
7、sponse.write alert(错误:找不到数据库文件!);history.back(); response.end End If end if if Request.QueryString(action)=reload then currf=request.form(currf) currf=server.mappath(currf) backf=request.form(backf) if backf= then response.write alert(请输入您要恢复的数据库全名);history.back(); else backf=server.mappath(backf) e
8、nd if on error resume next Set objfso = Server.CreateObject(Scripting.FileSystemObject) if err then err.clear response.write alert(不能建立fso对象,请确保你的空间支持fso:!);history.back(); response.end end if if objfso.fileexists(backf) then objfso.copyfile &backf&,&currf& response.write alert(恢复数据库成功);history.back
9、(); response.end else response.write alert(错误:备份目录下无您的备份文件!);history.back(); response.end end if end if % 备份数据库 要求空间支持FSO 数据库路径: input type=text name=currf size=20 value= readonly 备份数据目录: 数据库名称: 注:尽量不要更改以上项 恢复数据库 要求空间支持FSO 当前数据库路径: input type=text name=currf size=20 value= readonly 备份数据库路径: =数据库管理数据
10、库管理系统%Dim ZC_DATABASE_PATH数据库的路径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 CompressData 压缩数据Dim tmprsdim allarticledim Maxiddim topic,username,dateandtime
11、,bodycall CompressData()case BackupData 备份数据if request(act)=Backup Thencall updata()elsecall BackupData()end Ifcase RestoreData 恢复数据dim backpathif request(act)=Restore ThenDbpath=request.form(Dbpath)backpath=request.form(backpath)if dbpath= Thenresponse.write Please input your database whole Name el
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 备份 恢复
限制150内