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

📄 admin_yasuo.asp

📁 本实例为一个完整的网上购物商城的完整例子程序,里面有所以的源代码.希望对大家学习有用.
💻 ASP
字号:
<!--#include file="Conn.asp"-->
<%
if session("admin_name")="" then
        response.redirect "error.asp?error=001"
end if
%>
<body bgcolor="#FFFFCC" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="1" cellpadding="2" vspace="0" hspace="0" bgcolor="#FFFFFF">
<tr bgcolor="#FFCC33">
<td height="27" bgcolor="#FFCC33" background="images/admin_bg_1.gif">.:: 56770网络制作 http://www.56770.com</td>
</tr>
</table>
<div align="left">
<p><font size="2">++++++++++++++++++++压缩操作开始++++++++++++++++++++<br>
<br>
<font color="RED">注意:由于本程序是通过FSO权限和JET引擎连接模式,因此可能导致数据库出错,请在压缩之前备份原始数据库,以防万一!<br>
当前使用的数据库无法压缩,另外就是必须要有FSO(filesystemobject)权限,否则也会出错!<br>
</font></font><font size="2"><br>
<%
Const JET_3X = 4
Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath
strDBPath = left(dbPath, instrrev(DBPath, "\"))
Set fso = CreateObject("Scripting.FileSystemObject")
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")
Set fso = nothing
Set Engine = nothing
CompactDB = "您所指定的数据库," & dbpath & ", 已经被压缩" & vbCrLf
Else
CompactDB = "您所输入的数据库路径或名称未找到,请重试" & vbCrLf
End If
End Function
%></font></p></div>
<form name="xxyf" method="post" action="admin_yasuo.asp">
<div align="center"><font size="2">请输入您的数据库全称(包括扩展名,支持任何扩展名的ACCESS数据库)<br>
<br>
<input type="text" name="dbpath" value="<%=db%>" size="30">
<br>
<input type="submit" name="submit" value="确认压缩">
</font></div>
</form>
<div align="center"><font size="2">
<%
Dim dbpath, boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
response.write(CompactDB(dbpath, boolIs97))
End If
%>
<br>
+++++++++++++++++++++++++代码结束 +++++++++++++++++++++++++</font></div>

⌨️ 快捷键说明

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