reduce.asp
来自「购物系统时尚版.强大的后台文章编辑器的功能」· ASP 代码 · 共 79 行
ASP
79 行
<!--#include file="chk.asp"-->
<html><head><title>数据压缩</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
</head>
<body>
<!--#include file="TopManu.asp"-->
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td background="image/admintoptdbg.gif">
<p align="left">
<img border="0" src="image/title_arrow.bmp" width="17" height="27" align="absmiddle"><font color="#808080"><b>数据压缩</b></font></td>
</tr>
</table>
<table border="1" width="100%" id="table1" cellspacing="1" style="border:1px solid #C0C0C0; border-collapse: collapse; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#CCCCCC" cellpadding="4">
<tr>
<td><form action=reduce.asp>
<b>注意:</b>( 需要FSO支持,FSO相关帮助请看微软网站 ) <br>输入数据库所在相对路径,并且输入<font color="red">正确</font>的数据库名称和密码,名称和密码同时正确数据库才会被压缩成功。(<font color="red">正在使用中数据库不能压缩,请选择备份数据库进行压缩操作</font>)
<BR>压缩数据库:<input type="text" name="dbpath" value="../jj_Databackup/byec_shop.mdb">
<BR>数据库密码:<input type="text" name="password">
<BR><input type="submit" value="开始压缩">
</form></td>
</tr>
</table>
</div>
<table border="0" width="760" id="table3" cellspacing="0" cellpadding="0" align=center>
<tr>
<td align=right><input TYPE="button" VALUE="刷新本页" ONCLICK="location.reload()"> </td>
</tr>
</table>
<%
Dim dbpath,password
dbpath = request("dbpath")
password = request("password")
If dbpath <> "" Then
Const JET_3X = 4
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath))
End If
Function CompactDB(dbPath)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath,instrrev(DBPath,"\"))
strDBPath = strDBPath & "temp.asp"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
Set Engine = CreateObject("JRO.JetEngine")
On Error Resume Next
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password='" & password & "';Data Source=" & dbpath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password='" & password & "';Data Source=" & strDBPath
fso.CopyFile strDBPath ,dbpath
fso.DeleteFile(strDBPath)
Set fso = nothing
Set Engine = nothing
CompactDB = "操作完成。<br>如果密码正确你的数据库, " & dbpath & ", 将会被压缩!" & vbCrLf
Else
CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf
End If
End Function
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?