M
Mark Schneider
I am trying to automate compacting of adp-Files.
Altough adps do not contain any database data anymore they can be
compacted using the menu command and there sometimes is a significant
change in filesize.
I need to compact adps from an external app and tried the following:
a.
DBEngine.CompactDatabase "c:\test\myapp.adp", "c:\test\myapp_compacted.adp"
--
seems not to work for adps...
b.
Dim objAccess
Set objAccess = CreateObject("Access.Application")
objAccess.SysCmd 602, "C:\SPATest\SPA_MAIN_SOURCE.adp",
"C:\SPATest\SPA_MAIN_SOURCE_comp.adp"
--
seems not to work for adps...
c.
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
--
seems to work but is kind of clumsy... and I dont know how
do determine whether it worked and when it is finished
d.
shell "msaccess.exe c:\spatest\SPA_MAIN_SOURCE.adp /compact /repair"
--
works but may be disallowed/unavailable on the clients pcs and I dont know
how
do determine whether it worked and when it is finished
I really need a way to compact an external adp preferably to a new filename.
Why?
Because I want to automate the generation and upload of an app to multiple
servers and don't want to go to each adp manually to compact before doing
so.
Do you have any other suggestions?
Thanks in advance
Mark
Altough adps do not contain any database data anymore they can be
compacted using the menu command and there sometimes is a significant
change in filesize.
I need to compact adps from an external app and tried the following:
a.
DBEngine.CompactDatabase "c:\test\myapp.adp", "c:\test\myapp_compacted.adp"
--
seems not to work for adps...
b.
Dim objAccess
Set objAccess = CreateObject("Access.Application")
objAccess.SysCmd 602, "C:\SPATest\SPA_MAIN_SOURCE.adp",
"C:\SPATest\SPA_MAIN_SOURCE_comp.adp"
--
seems not to work for adps...
c.
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
--
seems to work but is kind of clumsy... and I dont know how
do determine whether it worked and when it is finished
d.
shell "msaccess.exe c:\spatest\SPA_MAIN_SOURCE.adp /compact /repair"
--
works but may be disallowed/unavailable on the clients pcs and I dont know
how
do determine whether it worked and when it is finished
I really need a way to compact an external adp preferably to a new filename.
Why?
Because I want to automate the generation and upload of an app to multiple
servers and don't want to go to each adp manually to compact before doing
so.
Do you have any other suggestions?
Thanks in advance
Mark