I have an Access database as a web database. I want to update some tables in the database when no one is accessing it. How do I write the code to detect on one else is access the database except me?
If you'll post your email address I'll send you an mdb that contains code and a form to determine who is logged onto a network at any particular time. I didn't write this, but I use it and it works fine - really a cool tool.
Although the last post, which references code to report network user connections, is helpful, the only definitive way of solving your problem is as follows ... and its simple.
Open up your Access database in exclusive mode. If you successfully open it up in exclusive mode, you can safely perform your database work knowing that noone else can gain access to it. If someone else is in, you'll be informed that an exclusive access attempt is not possible.
You might want to use the tool mentioned in the previous post to identify who might be preventing you from getting exclusive access, but, the key is getting exclusive access.
Zero did look at my question from another perspective.
However, I still need Jack's code. The database I talked about is a web database, so I prefer not to open it exclusively since I do not want to block internet users from accessing the database.
It takes only a few seconds to udpate the tables I need in the database. What I want to do is to create the function making sure no one else is accessing the database, and then update the tables immediately.
Did I make the issue too complicated? Each time when an Internet user accesses the database, the process only takes one or two seconds. So the chance that I and any Internet user access the database at the same time is small. Maybe I should just go ahead to update the tables without any detection.
"The ldb file cannot be useful to me, since when I am using the database, the ldb file is always present."
Just for information and future reference, you can open the ldb file using Notepad. This will display the names of all users logged on to the database at that time.
UnckeJack, that code which you and Seaport have been discussing: would it be possible to mail it to me?
I am also looking for a way to check who it using the database.
My address is nachandler@hotmail.com
I am also looking for a simple way to set up a transaction log to keep track of who does what in my database. I say "simple" because I am quite a new user. So if anyone can help that would be great.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.