M
M Skabialka
What is the correct format of the function to compact a database in Access
2007? I run some code which deletes then adds a few thousand records to the
database back end, which bloats it to about 65 MB, so I want to add a step
at the end to compact it back down to about 15 MB.
I am trying to compile this code, but .CompactDatabase is highlighted and
the error message is "Compile Error: Argument not Optional"
I have tried these variations:
DBEngine.CompactDatabase ("C:\Documents and Settings\me\My Documents\Test
compact database.mdb")
DBEngine.CompactDatabase "C:\Documents and Settings\me\My Documents\Test
compact database.mdb"
Do I have to create a new database when I compact one - is that the problem?
If I compact manually I don't have to specify a new name.
Mich
2007? I run some code which deletes then adds a few thousand records to the
database back end, which bloats it to about 65 MB, so I want to add a step
at the end to compact it back down to about 15 MB.
I am trying to compile this code, but .CompactDatabase is highlighted and
the error message is "Compile Error: Argument not Optional"
I have tried these variations:
DBEngine.CompactDatabase ("C:\Documents and Settings\me\My Documents\Test
compact database.mdb")
DBEngine.CompactDatabase "C:\Documents and Settings\me\My Documents\Test
compact database.mdb"
Do I have to create a new database when I compact one - is that the problem?
If I compact manually I don't have to specify a new name.
Mich