Exclusivity issue

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi all,

On a form I have a button that run this:(This is part of the sub)
Call DBEngine.CompactDatabase(srcFileName, destFileName)

My DB is split and the command above runs on the BE from the FE.

When I try to run it from FE, I get error message that the user opened the
database exclusivly and the sub stop.
When I start the FE with shift and I run it from the form, it's fine.

What has to be done in order to fix this?


I hope I'm clear.

Thanks for the help,

Tom
 
Hi Tom,

When you run it from your front-end, I strongly suspect that you need to
close any open connections. Usually, maintaining a permanent connection to
the BE database is a very good thing to do. However, in this case, I believe
you would need to close any open connections prior to running your code from
the FE database. To verify closed connections, you should not see a locking
database file (*.LDB) for the BE database.

Do you have any forms open at the time that are bound to a table in the BE
database? If not, do you have a global recordset open? Me thinks that by
opening the database with the shift key down, you are preventing such a
connection from being established, so your code works just fine.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top