数据库大小不变??

82yuxuan 2003-08-24 06:54:29
高手,为什么把数据库里面的内容都删除了,但是它的大小不会变???要怎么才可以把它变小?
...全文
32 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
82yuxuan 2003-08-25
  • 打赏
  • 举报
回复
no one can answer it?
wolf004 2003-08-24
  • 打赏
  • 举报
回复
如果什么都不设,数据库就不会小了,这样即可
511214 2003-08-24
  • 打赏
  • 举报
回复
如果是SQL SERVER 2000,选中要改变大小的数据库,右键-所有任务-收缩数据库即可
ceocio 2003-08-24
  • 打赏
  • 举报
回复
如果是access数据库,打开access运行工具-数据库实用工具-压缩和修复数据库即可
楚人无衣 2003-08-24
  • 打赏
  • 举报
回复
access用数据库压强方法,用代码实现:
'压强代码:
if request("compress")="压 缩" then
dbpath=server.mappath("../"&request("dbpath"))
if dbpath<>"" and fso.fileexists(server.mappath("../"&request("dbpath"))) then
set fs=fso.getfile(server.mappath("../"&request("dbpath")))
ofsize=fs.size '原数据库大小
set fs=nothing
strdbpath=left(dbpath,instrrev(dbpath,"\"))
set engine=createobject("jro.jetengine")
engine.compactdatabase "provider=microsoft.jet.oledb.4.0;data source="&dbpath, _
"provider=microsoft.jet.oledb.4.0;data source="&strdbpath&"temp.mdb"
fso.copyfile strdbpath&"temp.mdb",dbpath
fso.deleteFile strdbpath&"temp.mdb"
set fs=fso.getfile(server.mappath("../"&request("dbpath")))
nfsize=fs.size '压缩后的大小
set fs=nothing
set engine=nothing
cflag="true" '压缩成功标识
else
cflag="false" '压缩失败标识
end if
end if

'表单代码:
<form method="POST" action="adbbsdata.asp">
<fieldset bordercolor="#FF00FF">
<legend><font size="2" color="#000080">数据库压缩</font></legend>
<div style="margin-left: 8">
数据库路径:<input type="text" name="dbpath" size="30" onMouseOver = "this.style.backgroundColor = '#95BBFF'" onMouseOut = "this.style.backgroundColor = ''" style="position: relative; height: 20; border-left-style: solid; border-left-width: 0; border-right-style: solid; border-right-width: 0; border-top-style: solid; border-top-width: 0; border-bottom-style: solid; border-bottom-color: #000080" value="database/sbbs.asp"><br>
<br>
<input type="submit" value="压 缩" name="compress" onMouseOver = "this.style.backgroundColor = '#95BBFF'" onMouseOut = "this.style.backgroundColor = '#FFFFFF'" style="position: relative; height: 20; background-color: #FFFFFF; color: #000080; border-style: solid; border-width: 1"> 
<input type="reset" value="重 置" name="reset" onMouseOver = "this.style.backgroundColor = '#95BBFF'" onMouseOut = "this.style.backgroundColor = '#FFFFFF'" style="position: relative; height: 20; background-color: #FFFFFF; color: #000080; border-style: solid; border-width: 1">
<font color="#FF00FF"><%if cflag="true" then%>压缩成功!  原来大小:<%=ofsize/1024%>K 现在大小:<%=nfsize/1024%>K<%elseif cflag="false" then%>原文件不存在,压缩失败!<%end if%></font>
</div>
</fieldset>
</form>

82yuxuan 2003-08-24
  • 打赏
  • 举报
回复
啊,那要怎么才可以变小????就算把里面的东西跟表格都删除,还是一样大小。

没有办法变小吗?难道要重新建立一个数据库么?
RadishRabbitGao 2003-08-24
  • 打赏
  • 举报
回复
空数据库的大小是由其结构决定的
82yuxuan 2003-08-24
  • 打赏
  • 举报
回复
ceocio(MS Community Star),不行呀,按照你的方法,数据库大小还是没有变。

weizi2000(秋风啊) 有必要做压缩吗?只有这个方法才可以把数据库变小?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧