And without using DAO. I have a program writen in ADO (DAO was giving me some packaging problems). It uses a tag-along Access Database to store/access data for the front end. This database will have data imported into it and removed from it often. I'm looking for a method using ADO where I could compact the database from VB.
I know of these methods:
1) Command Line:
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Test\Test.mdb" /compact
(Won't work, most users won't have Access Installed)
2) Using another Database containing Compact Code:
Dim stAppName As String
stAppName = "MSAccess.exe ""C:\SpecialTax\SpecTaxCompact.mdb"" "
Call Shell(stAppName, 1)
Docmd.Quit
(Won't work, again, no Access on these machines)
3) DAO:
DBEngine.RepairDatabase Name.MDB
DBEngine.CompactDatabase Name.MDB, Another.MDB
(Trying to avoid DBO Because it gives me so many problems)
I know of these methods:
1) Command Line:
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Test\Test.mdb" /compact
(Won't work, most users won't have Access Installed)
2) Using another Database containing Compact Code:
Dim stAppName As String
stAppName = "MSAccess.exe ""C:\SpecialTax\SpecTaxCompact.mdb"" "
Call Shell(stAppName, 1)
Docmd.Quit
(Won't work, again, no Access on these machines)
3) DAO:
DBEngine.RepairDatabase Name.MDB
DBEngine.CompactDatabase Name.MDB, Another.MDB
(Trying to avoid DBO Because it gives me so many problems)