Hi there… I am using Access ’97 and trying to write an event procedure to compact my database files…
I am using the DBEngine.CompactDatabase method… Does anyone know why I would be getting error message “Invalid argument”, Run-time error ‘3001’ on this line?:
DBEngine.CompactDatabase DBName, NewDBName
I did define and set the values of the two variables? …I don’t get it… Three different references I have checked shows using this syntax… Any help would be appreciated…
Oh ya… One other thing… I notice that most often in the books I am reading, etc… the database files are compacted to a different file… (I’m assuming this is the same as making a backup copy, but condensed…) …What I want to know is whether I may encounter problems when I compile the actual file itself… (In case I’m not making any sense… I’ll give an example…)
If I have a database file:
DBFile.mdb 278MB’s
and I compact it to a different name… I then have…
DBFile.mdb 278MB’s and
DBFileBU.mdb 14MB’s
Obviously I was compacting the file because I wanted to increase my available disk space … Not at all accomplished by this task…
So I have been compacting the file itself as well… giving me:
DBFile.mdb 14MB’s
DBFileBU.mdb 14MB’s
Does anyone anticipate my running into problems with this?
Thanks for your time… …Have a great Friday everyone!