View Full Version : Which recordsets open


macca the hacke
03-22-2007, 07:37 AM
Hi

I have an issue with my database since I split it into 2.
Once I have opened my main form whenever I try and change existing queries, forms etc I get the warning - you do not have exclusive access to the database at this time. If you proceed to make changes, you may not be able to save them later.
I know other users are not in the database, so must be some of my code that opens recordsets to look for data. I have referenced all of them to the back end (opendatabase(backend)) rather than currentdb(). I am sure that all of them set db back to nothing once they have finished, so cannot think what is locking the database.
Is there any way of getting access to list all open recordsets, so I can find out what is happenning?

Ta

MStef
03-22-2007, 11:53 PM
Did you try to open your mdb as EXCLUSIVE OPEN ??

macca the hacke
03-23-2007, 12:50 AM
Hi

Thats solves the issue, although I cannot use this as the solution as more than 1 person needs to access the database at once.

Rob

MStef
03-23-2007, 02:30 AM
If you want more users to work at once,
put "SHARED" IN "Default open mode",
(Tools, Options, Advanced), check "Default
record locking" too.

macca the hacke
03-23-2007, 02:35 AM
Thanks MStef
That was what I had in there originally! The issue is not whether the database is shared or exclusive. The issue is that the database thinks it is open more than once because there are recordsets being opened (and not closed) in the background. I need to find out which one is staying open and tricking the database into thinking it is open more than once

MStef
03-23-2007, 02:44 AM
Try next:
Go in the directory where yor mdb is, (Windows explorer).
Find .ldb file, (the same name as your mdb, 1KB), delete it and try.

macca the hacke
03-23-2007, 02:49 AM
Thanks.
I know how to get the database back into thinking there is only 1 person in it - that is not a problem.
My problem is stopping the issue arising in the first place!