Access数据库的问题!

来源:百度知道 编辑:UC知道 时间:2024/06/03 22:49:41
我用的是花香的Access数据库,我的网站在运营一段时间后,Access数据库的容量涨的很快.于是我就想把一些陈旧的信息删除来减少Access数据库的容量.但是我发现,无论我是在后台删除文件,还是直接打开Access数据库删除里面的信息,Access数据库的容量都是固定不变的!!!
当然我要删除的信息已经删除了.但是我不明白的是,为何我已经删除了文件,Access数据库也没有这条信息,为何Access数据库的容量还是没有变小呢?
请指点,本人诚心学习!

要使用数据库压缩,工具菜单-数据库实用工具-压缩和修复数据库

除了使用ACCESS软件压缩外,也可以在线压缩.
下面是我个人使用的适用于ACCESS2000以后版本
'用法
在压缩前先关闭连接
Conn.Close
Set Conn=Nothing

'操作会返回0或1代码
op=lq_dbase_comp("你的数据库路径")
if op=0 then
Response.Write "压缩成功"
else
Response.Write "压缩失败"
end if
Response.End

'过程
Function Lq_Dbase_Comp(Lq_Dbase_Comp_Path)
Lq_Dbase_Comp_Err=0
If Lq_Dbase_Comp_Path="" then
Lq_Dbase_Comp_Err=Lq_Dbase_Comp_Err+1
End If
If Lq_Dbase_Comp_Err=0 then
Lq_Dbase_Comp_Path=Server.Mappath(Lq_Dbase_Comp_Path)
Lq_Dbase_Comp_tmp1=Lq_Dbase_Comp_Path
Lq_Dbase_Comp_tmp2=Left(Lq_Dbase_Comp_Path,InstrRev(Lq_Dbase_Comp_Path,"\"))
Set Lq_Fso = CreateObject("Scripting.FileSystemObject")
If Lq_Fso.FileExists(Lq_Dbase_Comp_tmp1) Then
Set Lq_Engine = CreateObject("JRO.JetEngine")
Lq_Engine.CompactDatabas