Function RepairDatabase(strSource As String, _
strDestination As String) As Boolean
' Input values: the paths and file names of
' the source and destination files.
' Trap for errors.
On Error GoTo error_handler
' Compact and repair the database. Use the return value of
' the CompactRepair method to determine if the file was
' successfully compacted.
RepairDatabase = _
Application.CompactRepair( _
LogFile:=True, _
SourceFile:=strSource, _
DestinationFile:=strDestination)
' Reset the error trap and exit the function.
On Error GoTo 0
Exit Function
' Return False if an error occurs.
error_handler:
RepairDatabase = False
End Function
作者: 李寻欢 时间: 2003-3-29 22:55
谢谢!作者: ail 时间: 2003-7-15 08:05
不明白
如何我要把后端的数据库如a.mdb当点击后压缩,注意不是压缩前台,该如何做呢?作者: cg1 时间: 2003-7-15 16:14
http://access911.net/index.asp?board=4&mode=3&recordid=71FAB71E
http://access911.net/index.asp?board=4&mode=3&recordid=76FABF1E17DC作者: ail 时间: 2003-7-16 08:00
谢谢作者: ail 时间: 2003-7-16 08:10
忘记这一点了:后台数据库有密码,因而提示错误,但我不知如何做?作者: 徐阿鹏 时间: 2003-7-16 16:48
在系统菜单中-》工具-》选项-》常规-》关闭时压缩作者: ail 时间: 2003-7-17 19:45
也就是说在后台的ACCESS的选项中把每次关闭时压缩就可以,是这样吗,不用VBA可以吗?我以前就是这样,但不觉得已压缩的感觉,倒是前台每次关闭压缩有感觉。
若我想用一按钮来控制后台压缩,如何做呢?(最好的,因为当数据大时控制比较好。)