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

📄 compact.asp

📁 本源代码为大学生购物网的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<html> 
<head> 
<title>数据库压缩程序</title> 
</head> 
<body> <!--#include file="top.asp"--><div align="center">
	<table border="0" width="80%" cellpadding="2" id="table1">
		<tr>
			<td>
<div> 
<div align="center"><br> 
</div> 
<div><br> 
	使用之前请确认你的服务器支持FSO(filesystemobject)权限并安装的ACCESS最新驱动!从安全出发,请在压缩之前备份原始数据库!</div><br> 
<div align="center">运行环境:在WIN98SE+PWS、WIN2000+IIS5.0 <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 
%> 
</div> 
</div> 
<form name="compact" method="post" action="compact.asp"> 
<div align="center"><font size="2"><b><font color="#FF0000">压缩选项,请仔细填写!</font></b><br> 
<br> 
输入数据库全称: 
<input type="text" name="dbpath" value="../dadsdfte/#sho%p.asa">
(包括扩展名,如MDB、ASA、ASP等)<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></td>
		</tr>
	</table>
</div><!--#include file="copy.asp"-->
 

⌨️ 快捷键说明

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