⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_compressdata.asp

📁 购物系统(本版为正式商业版
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Redirect "login.asp"
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if
if qx20<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限!</b></font></div>"
response.End
end if
if request("action")="Backup" then
call backupdata()
else
dim tmprs
dim allarticle
dim Maxid
dim topic,username,dateandtime,body
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
	response.write(CompactDB(dbpath,boolIs97))
End If

Const JET_3X = 4

Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next 
If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")

	If boolIs97 = "True" Then
		Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
		"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;" _
		& "Jet OLEDB:Engine Type=" & JET_3X
	Else
		Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
		"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
	End If

fso.CopyFile strDBPath & "temp.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")

if err.number="0" then
  response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 你的数据库已经压缩成功!"&dbpath&"');window.location.href='admin_compressdata.asp';</script>"
  response.end
else
  response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 压缩过程中出现错误,具体出错如下:"&Err.Description&"');window.location.href='admin_compressdata.asp';</script>"
	err.clear
	response.end
end if
Set fso = nothing
Set Engine = nothing


Else
  response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 数据库名称或路径不正确. 请重试!');window.location.href='admin_compressdata.asp';</script>"
	response.end
End If

End Function
%>
<!--#include file="../webconfig.asp"-->
<html>
<head>
<title>管理中心</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="../css.css" TYPE="text/css">
<style type="text/css">
<!--
.style4 {color: #000000}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/right_top2.gif">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td width="30%" style="font-size:14px;color:#ffffff"><span class="style4">&nbsp;<b>数据库压缩</b> </span></td>
          <td width="70%" align="right">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table><br>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4" style="border-collapse: collapse">
  <form action="" name="form1" method="post">
    <tr valign="middle"> 
	  <td height="23" bgcolor="#C7D3E6">	  <b> 注意:</b>( 需要FSO支持,FSO相关帮助请看微软网站 ) </td>
	</tr>
    <tr valign="middle">
      <td height="23" bgcolor="#F0F3F8">输入数据库所在相对路径,并且输入数据库名称(<font color="red">正在使用中数据库不能压缩,请选择备份数据库进行压缩操作</font>) </td>
    </tr>
    <tr valign="middle">
      <td height="23" bgcolor="#F0F3F8">压缩数据库:
        <input name="dbpath" type="text" class="wenbenkuang" value=../databackup/shop.mdb size="30">
&nbsp;</td>
    </tr>
    <tr valign="middle">
      <td height="23" bgcolor="#F0F3F8"><input name="submit" type="submit" class="go-wenbenkuang" value="开始压缩">
        </td>
    </tr>
    <tr valign="middle">
      <td height="23" bgcolor="#F0F3F8"><input type="checkbox" name="boolIs97" value="True">
如果使用 Access 97 数据库请选择 (默认为 Access 2000 数据库)</td>
    </tr>
  </form>
</table>
<%end if%><br><br>
<!--#include file="copyright.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -