Thanks Kurt,
I don't post that often so I guess I was not paying attention. I use Thunderbird email client (recommended by someone on this list - long ago, I forget who).
I think my original message was not clear enough. I have no issue keeping people out once the files are locked. There are several good ways to do that.
My problem was: how to know if someone is logged into the same folder with the same data files. What I plan to do is use TRY/CATCH and trap the error and let the 2nd person logging in know that the program s/he wants to use to lock files is not available. I will warn her/him that someone else may be logged in. Alternatively, the Windows OS still has a file locked for no known reason like it does sometimes.
On 7/24/2019 9:14 AM, Kurt @ Gmail wrote:
Hey Ken,
I hear you about your woes of a user still in system. But, gotta say - you should have posted this reply to the group instead of just me. And, since I replied via Gmail - I don't actually get to see my own reply. Its funny though - since Another person in the forum posted the SAME Suggestion - about a single file/record as a semaphore. I think it may have been Ted. I say - Great minds think alike.
OF course, maybe it was ME who Blew it and Only put my reply to You and NOT to the forum! If so - my bad...
-K-
On 7/23/2019 2:18 PM, Ken McGinnis wrote:
I do have that and it does work to keep users out - if they come in after the 'lock' is set.
The problem is: a user that is already in the system, but not doing anything. I can't figure a way to know that user is in the software. s/he has no files locked and is not accessing any data, just sitting at the menu (for example)
On 7/23/2019 9:57 AM, Kurt @ Gmail wrote:
Why not create a single file - with a single record, a File Lock Flag. So - when a user goes to reindex files - they MUST Lock that one record 1st. Then, at the startup of your system - for regular users - the system must check that flag & record to see if someone locked it and is indexing files.
It's a thought...
-K-
On 7/23/2019 10:36 AM, Ken McGinnis wrote:
We have a vfp9 SP2 program that has been running nearly bug free for over 10 years. Only now we have a need to find out if anyone else is using the exe in a specific folder. We allow many users to have their own unique folder with their patient data files.
So we log into folder 1 and another user is in folder 2. No problem.
If we log into folder 1 and another user is in that same folder, again no problem. Our software is multi-user down to the individual record level. The problem is when the 2nd user comes in and needs to lock many or all files to reindex or other procedures. How can the 2nd user know that another user is there? Again it is not a problem until that 1st user starts to do something, almost anything that requires accessing files. All files are locked by the 2nd user so the 1st user starts getting errors.
We could try to lock the exe and that would fail so we would know someone else is using the software. However, if that other user is working with data in a different folder, we don't care so we do not want to lock the exe.
Hope that is clear
[excessive quoting removed by server]