Compact problem

  • Thread starter Thread starter Phill
  • Start date Start date
P

Phill

I have just convert an Access 97 database to Access
2000. I have a line of code that compacted another
database (that I also converted to Access 2000) into a
new database for distribution. The database being
compacted does not use Access security, just the standard
Admin. The database making the compact request does use
Access security. The security file is specified in the
shortcut, I don't join another workgroup file. This is
the code: DBEngine.CompactDatabase
strExternalDB, strAttachDB, , dbEncrypt

It used to work in the Access 97 world, but now I get a
message saying I don't have permission to do so. Prior
to the compact, I open the database and export some
tables. This works fine, not permission violations.
What is the difference? What's going on here? Thanks
for you help.
 
Is this the only problem you're having? The DBEngine Object is a DAO object.
Open a code window and go to Tools|References and check to see if "Microsoft
DAO 3.6 Object Library" is checked. If an earlier version is checked,
uncheck it and scroll down the list to check the newer one. Are any of the
checked references listed as "MISSING"?
 
I have already changed the reference to DAO 3.6, all
other code seems to be working fine. There are no
missing references. Any other ideas?

Thanks, Phill
 
Is this also a new computer with NT (Win2k or WinXP) on it by chance? If so
and if the drive is in the NTFS format, do you have permissions to create a
new file in the folder you are trying to compact into? If the folder is
across a network, does the share give you permission to create a new file?
 
The command line appears to be correct. The locale and password options are
the only options you're not using. Has anything else changed except for the
update to 2000? Is the new database being placed in a different folder that
may have introduced spaces in the path?
 
Back
Top