Growing MS Access File Size problem

后端 未结 9 477
庸人自扰
庸人自扰 2021-01-12 08:41

I have a large MS Access application with a lot of computations in VBA code. When I run it it eventually crashes due to excessive file size. There are a lot of intermediat

9条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 09:10

    You should be able to run the compact function from within your VBA code.

    I had the below snippet bookmarked from a long time ago when I was doing access work.

    Public Sub CompactDB() 
        CommandBars("Menu Bar").Controls("Tools").Controls("Database utilities").Controls("Compact and repair database...").accDoDefaultAction 
    End Sub 
    

    You can put that in your code to get around it.

    NOTE: you might also consider growing to a larger db system if you are having these types of scaling issues.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题