-
Please do not send me to read help about CompactDatabase function. I did it many times. I have DB "MyDB.mdb" with Password "MyPassword" located on C:\. I'd like somebody give me exact code to compact MyDB from VB. And second question: how to find out if somebody is connected to that database through network before compacting.
Thank you.
Vlad
-
I assume that you tried...
DBEngine.CompactDatabase "C:\MyDB.mdb","C:\MyNewDB.mdb",,";pwd=MyPassword"
and it didn't work?
If you attempt to do the compact, you should be able to trap the error that says someone is still in the database. Or you could look at the Users collection
for i = 0 to dbengine.workspaces(0).users.count -1
dbengine.Workspaces(0).Users(i).Name
next i