rich.barry
05-09-2004, 03:39 PM
Hello People
I'm trying to detect which users are connected to the database so that when I need to update the FE, I know who to kick off.
Initially I have used OpenSchema to give me a list of the PC names, which has been fine up to when the company introduced Citrix.
Now everyone logged on via Citrix shows up as the Citrix server.
I also use the API call GetUserName for determination of your rights at logon, but can't think of how to use GetUserName to query someone elses PC.
Any ideas?
Thanks
Richard
ghudson
05-09-2004, 08:44 PM
The Environ() function is an easy way to extract the users network name.
MsgBox Environ("UserName")
Because of Citrix you will have to create a method in your db that checks a value in a hidden table that uses the forms timer. If the value is set to "Yes" then you will close the users front end. If the value is set to "No" then you do not close the users front end. There are posts that explain [maybe offer a sample] on how to do this but that is the general idea. You could cause problems if you force a user out when they are in the middle of running a function [update records, writing a record].
You could use the Net Send command and send a direct screen message to the users computer. Search the threads with the key word "net send" and user name ""ghudson" for I have posted the code to send a single computer message.
rich.barry
05-10-2004, 02:18 PM
I like the Environ command - much tider than the API call - but it doesn't quite solve my problem.
Environ answers a "Who am I ?" question, where I am trying to answer a "Who are you ?"
I already use timer to check whether to log out if a flag is on, but often someone has left data unsaved (production line operators), and such PC's will not log off. I have to determine who it is and go and close their front end.
The only means that comes to mind is for each open FE to write their own username & PC name to a table on a timer event. If I clear the table, then the names that subsequently write to it are those people still logged on.
Richard
namliam
05-11-2004, 12:12 AM
If you open the ldb file in notepad you can read what machine is loged on with what user...
Tho this is not 100% because ppl can have a crash and still be in the ldb.... but its a start....
You could also use a table to log everyone thats in the DB (entry time) and delete the record when they leave, or compleet the record with an exit time....
You could then query the table to see who is in you DB....
Regards