I am developing an application with multi-user functionality in mind. It currently has the mde/mdb split feature, and I am working on adding some data integrity routines that use formal database transactions and pessimistic locking to minimize confusion if two users try to edit the same information.
Despite the lengths to which I have gone for user-friendliness, I think it is still undesireable to have two instances of the application running on the same taskbar. It is confusing to the user, even though it may be technically safe.
I am not completely satisfied with any solution I have found on experts-exchange.com so far. This is probably among the best:
I agree with the possibility of checking the taskbar for a certain application title, but I feel this is a bit sloppy. This solution requires that most of my Startup routines be complete (including the part that sets the title bar) before performing the test and ultimately closing the unwanted new instance. Yuck. I would be worried about two instances starting simultaneously and destroying each other.
Since I have a split database, it occurs to me that I should simply require the mde application to be opened in exclusive mode. Problem solved, right? Well, it's not quite that simple. In theory, the application should be structured to allow multiple connections to the mdb file and only one at a time to the local mde file. From what I have read, it is only possible to do this by checking for the presence of an ldb file in the mde's folder. Is there any better way to force the database application to be opened exclusively? What about application lockups? Would orphaned ldb files be a regular headache?
Then there's the issue of Fast User Switching, RDP, etc. (Yes, if your head starts to spin at this point it may be normal.) Did you figure out the problem? Let's say for the sake of simplicity that each user of the application has the mde file stored in their home folder so that each user may open the application exclusively on the same computer. Problem solved? Perhaps. I have not yet tested this configuration on Windows XP.
Again, my primary concern is that any one user might have unknowingly started a second copy of the application and become confused by locking errors while editing records or by unexpected results while switching between tasks.
I would like to have some discussion on this topic rather than have a single best solution. I will split out the points for anyone adding substance to the topic.