Compact Current Database via Other Database

Robert M

Registered User.
Local time
Today, 08:41
Joined
Jun 25, 2009
Messages
153
In all my study and research I think about the only way I will be able to compact my database (DB1) is from another database(DB2). But to do this I am needing to have (DB1) with a button that the user can press that would
1)open (DB2) to run the compact database program
2) close(DB1) so that it can be compacted
3) compact(DB1) and reopen it
4) close(DB2)

I do have a program that reads...

Dim external_db As Object
Dim DBase As Database

Set external_db = CreateObject("Scripting.FileSystemObject")
'COMPACT DATABASE BEFORE CLOSING
Set DBase = OpenDatabase("location of DB2")

My Problem is that when I run the program nothing happens. DB2 does not open to run it's program.

What am I missing here?

Thank you for your help on this matter.

Robert M
 
Why don't you just turn on the Compact On Close option?
 
DOH! (dope slap)

Ya mean that they have that option? 8-?

Thanks for the information, I'll check to see if my access version (2003 I think) has that. If so I'll make to close buttons, one to do a regular close the other to do a close and compact.

Thanks for your help with this ghudson.

Robert M
 

Users who are viewing this thread

Back
Top Bottom