BVB Source Codes

SXW Flash site v1.2 Show admin_data.asp Source code

Return Download SXW Flash site v1.2: download admin_data.asp Source code - Download SXW Flash site v1.2 Source code - Type:.asp
  1. <!--#include file="../data/mdb.asp"-->
  2. <%Admin="System"%>
  3. <!--#include file="check.asp"-->
  4. <!--#include file="../data/config.asp"-->
  5. <%
  6. if session("adminlogin")<>sessionvar then
  7.   response.Write "<script>alert('!您的权限不足!');top.location.href='index.asp';</script>"
  8.   response.end
  9. end if
  10. %>
  11. <html>
  12. <head>
  13. <title>SXW Flash Cms——数据库管理</title>
  14. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  15. <LINK href="inc/admin.css" type=text/css rel=stylesheet>
  16. </head>
  17. <body>
  18. <%
  19. select case request("action")
  20. case "godata"
  21. call godata()
  22. case "backdata"
  23. if request("act")="Backup" then
  24. call updata()
  25. else           
  26. call backdata()
  27. end if
  28. case "redata"
  29. if request("act")="data" then
  30. dim Dbpath,backpath,fso
  31.                         Dbpath=request.form("Dbpath")
  32.                         backpath=request.form("backpath")
  33.                         if dbpath="" then
  34.                         response.write "请输入您要恢复成的数据库全名"    
  35.                         else
  36.                         Dbpath=server.mappath(Dbpath)
  37.                         end if
  38.                         backpath=server.mappath(backpath)
  39.                
  40.                         Set Fso=server.createobject("scripting.filesystemobject")
  41.                         if fso.fileexists(dbpath) then                                         
  42.                         fso.copyfile Dbpath,Backpath%>
  43. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  44. <tr class=esing><td align="center"  height=25>恭喜恭喜!</td></tr>
  45. <tr height=50><td align="center">您的数据库已经成功恢复!请到首页进行调式! </td></tr></table>
  46. <%else%>
  47. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  48. <tr class=esing><td align="center"  height=25>错误提示!</td></tr>
  49. <tr height=50><td align="center">备份目录下并无您的备份文件! </td></tr></table>
  50. <%end if
  51. else
  52. call redata()
  53. end if
  54. end select
  55. %>
  56. <%
  57. '====================压缩数据库 =========================
  58. sub godata()
  59. %>
  60. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  61. <form action="Admin_data.asp?action=godata" method="post">
  62. <tr class=esing>
  63. <td height=25>&nbsp;※&nbsp;压缩备份数据库</td>
  64. </tr>
  65. <tr>
  66. <td  height=30>&nbsp;数据库文件:<input type="text" name="dbpath" value="GHOST#/#2ey.cn.asp">&nbsp;
  67. <input type="checkbox" name="boolIs97" value="True">如果使用 Access 97 数据库请选择
  68. (默认为 Access 2000 数据库)
  69. </td>
  70. </tr>
  71. <tr>
  72. <td height=30 align=center><input type="submit" value="压 缩" class=put onmouseover="this.className='overput'" onmouseout="this.className='put'">&nbsp;&nbsp;<font color="#FF0000">**为了安全,请注意用备份的数据库文件来压缩,不要用当前正在运行的数据库文件!</font>
  73. </td>
  74. </tr>
  75. <form>
  76. </table>
  77. <br>
  78. <%
  79. dim dbpath,boolIs97
  80. dbpath = request("dbpath")
  81. boolIs97 = request("boolIs97")
  82.  
  83. If dbpath <> "" Then
  84. dbpath = server.mappath(dbpath)
  85.         response.write(CompactDB(dbpath,boolIs97))
  86. End If
  87.  
  88. end sub
  89.  
  90. '=====================压缩参数=========================
  91. Function CompactDB(dbPath, boolIs97)
  92. Dim fso, Engine, strDBPath,JET_3X
  93. strDBPath = left(dbPath,instrrev(DBPath,"\"))
  94. Set fso = CreateObject("Scripting.FileSystemObject")
  95. If fso.FileExists(dbPath) Then
  96.         fso.CopyFile dbpath,strDBPath & "temp.mdb"
  97.         Set Engine = CreateObject("JRO.JetEngine")
  98.  
  99.         If boolIs97 = "True" Then
  100.                 Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
  101.                 "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb;" _
  102.                 & "Jet OLEDB:Engine Type=" & JET_3X
  103.         Else
  104.                 Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
  105.                 "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb"
  106.         End If
  107.  
  108. fso.CopyFile strDBPath & "temp1.mdb",dbpath
  109. fso.DeleteFile(strDBPath & "temp.mdb")
  110. fso.DeleteFile(strDBPath & "temp1.mdb")
  111. Set fso = nothing
  112. Set Engine = nothing%>
  113. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  114. <tr class=esing>
  115. <td height=25 align=center>
  116. <%
  117. CompactDB = "你的数据库【" & dbpath & "】已经压缩成功!" & vbCrLf
  118. %>
  119. <%Else%>
  120. 数据库名称或路径不正确. 请重试!
  121. <%End If
  122. End Function
  123. %>
  124. </td>
  125. </tr>
  126. </table>
  127. <%sub backdata()%>
  128. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  129. <tr class=esing>
  130. <td height=25>&nbsp;※&nbsp;备份数据库( 需要FSO支持,FSO相关帮助请看微软网站 )</td>
  131. </tr>
  132. <form method="post" action="Admin_data.asp?action=backdata&act=Backup">
  133. <tr><td height=25>
  134. &nbsp;备份数据库目录(相对路径):<input type=text size=25 name=bkfolder value="GHOST#">
  135. &nbsp;如目录不存在,<input type="hidden" size=25 name=DBpath value="<%=mdb%>">程序将自动创建</td></tr>
  136. <tr><td height=25>
  137. &nbsp;备份数据库名称(填写名称):<input type=text size=25 name=bkDBname value=#2ey.cn.asp>
  138. &nbsp;如备份目录有该文件,将覆盖,如没有,将自动创建</td></tr>
  139. <tr><td height=30 align=center>
  140. &nbsp;<input type=submit value="备 份" class=put onmouseover="this.className='overput'" onmouseout="this.className='put'"></td></tr></form></table>
  141. <%end sub
  142. sub updata()
  143.         dim Dbpath,bkfolder,bkdbname,fso
  144.                 Dbpath=request.form("Dbpath")
  145.                 Dbpath=server.mappath(Dbpath)
  146.                 bkfolder=request.form("bkfolder")
  147.                 bkdbname=request.form("bkdbname")
  148.                 Set Fso=server.createobject("scripting.filesystemobject")
  149.                 if fso.fileexists(dbpath) then
  150.                         If CheckDir(bkfolder) = True Then
  151.                         fso.copyfile dbpath,bkfolder& "\"& bkdbname
  152.                         else
  153.                         MakeNewsDir bkfolder
  154.                         fso.copyfile dbpath,bkfolder& "\"& bkdbname
  155.                         end if%>
  156. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  157. <tr class=esing><td align="center" height=25>恭喜恭喜!</td></tr>
  158. <tr height=50><td align="center">
  159. 备份数据库成功,您备份的数据库路径为<%=bkfolder%>\<%=bkdbname%>
  160. </td></tr></table>
  161. <%Else%>
  162. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  163. <tr class=esing><td align="center"  height=30>错误提示!</td></tr>
  164. <tr height=100><td align="center">
  165. 找不到您所需要备份的文件!
  166. </td></tr></table>
  167. <%End if
  168. end sub
  169. '------------------检查某一目录是否存在-------------------
  170. Function CheckDir(FolderPath)
  171.     dim fso1
  172.         folderpath=Server.MapPath(".")&"\"&folderpath
  173.     Set fso1 = CreateObject("Scripting.FileSystemObject")
  174.     If fso1.FolderExists(FolderPath) then
  175.        '存在
  176.        CheckDir = True
  177.     Else
  178.        '不存在
  179.        CheckDir = False
  180.     End if
  181.     Set fso1 = nothing
  182. End Function
  183. '-------------根据指定名称生成目录-----------------------
  184. Function MakeNewsDir(foldername)
  185.         dim f,fso1
  186.     Set fso1 = CreateObject("Scripting.FileSystemObject")
  187.         Set f = fso1.CreateFolder(foldername)
  188.         MakeNewsDir = True
  189.     Set fso1 = nothing
  190. End Function
  191. %>
  192. <%
  193. '====================恢复数据库=========================
  194. sub redata()
  195. %>
  196. <table width=98% align="center" border="1" cellspacing="0" cellpadding="3" class=esingcom style="border-collapse: collapse">
  197. <tr class=esing>
  198. <td height=25>&nbsp;※&nbsp;恢复数据库( 需要FSO支持,FSO相关帮助请看微软网站 )
  199. </td></tr>
  200. <form method="post" action="ADMIN_data.asp?action=redata&act=data">
  201. <tr><td height=25>
  202. &nbsp;备份数据库路径(相对):<input type=text size=40 name=DBpath value="GHOST#/#2ey.cn.asp" ><input type="hidden" size=40 name=backpath value="<%=mdb%>"></td></tr>
  203. <tr><td height=30 align=center>
  204. &nbsp;<input type=submit value="恢 复" class=put onmouseover="this.className='overput'" onmouseout="this.className='put'">
  205. </td></tr></form></table>
  206. <%end sub%>
  207.  
  208.  
downloadadmin_data.asp Source code - Download SXW Flash site v1.2 Source code
Related Source Codes/Software:
Flash - v3 universal back-end systems v1.2 - System contains a complete news picture. videos an... 2016-09-30
Party card online help system v1.0 - Party card online help system is copy code station... 2016-09-30
ASP online mass character to replace tool - The birth of this tool will become the bane of ASP... 2016-09-30
Simple Easy CRM customer management system v1.0 - Easy simple CRM customer relationship management (... 2016-09-30
Speed Pioneer Board (.spb) Speed Pioneer Chinese BBS v4.5 Acce - Software introduction &Nbsp;   developed... 2016-09-30
GuardianGenius Beta1 - The software is introduced 2016-10-01
Share music v0.1 - Listening to music when suddenly the ST produced a... 2016-10-01
All sincere mall multi-user version v5.1 SQL generated HTML - Use the "shop in shop" systems Second Edition upgr... 2016-10-01
SMS positioning Android project source code for application - This project is a based on android mobile phone re... 2016-10-01
The Android project source coarse imitation hungry? Take-out APP source code - This project is a similar hungry? Take-out APP dem... 2016-10-01
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top