How to Detect If Process Is Running?

carlnewton

Registered User.
Local time
Today, 12:01
Joined
Jan 10, 2008
Messages
19
I have learned how to redirect FE table links from a Master to a Replicated DB (and back again as needed). Now I'm trying to find a way to detect whether the user is logged on to the server remotely via VPN (vs attached to the network locally) and then reLink accordingly. If the user is remote then the VPN Client is running in the background and Windows Task Manager lists 'vpngui.exe' among the running processes. My thinking is that if I can find a way to determine that vpngui.exe is running then I can assume that the user is remote. I haven't had any success in finding a way to do this.

Any suggestions?
 
My first guess would be to check the LDB file. If one user is using the database, you have an LDB file. Using the LDBViewer.exe and accompanied files (.dll) you can question the ldb file for users.

Enjoy!
 
I'm afraid that won't do it for me. When a user tries to use the split database in remote mode through VPN it's unbearably slow, but it still works. So when users start the db it will connect with the master be and the user must sit and wait far too long for comfort before they can click a button to relink to the local replicated be. I would like to be able to determine immediately at startup whether the user is remote and then give the user the option to relink locally before the standard forms load.

Thanks for your input.
 
I found a solution here:

http://www.developerfusion.co.uk/show/4073/

I had to change the second chunk of code on that page to work as follows:

1. The following line, "lstProcess.Clear" had to be commented out. This is referring to a listbox and my ACCESS 2003 listbox doesn't include that function.

2. The following line, "If (lstProcess.List(hj) = "EXCEL.EXE") Then" had to be changed to replace lstProcess.List with lstProcess.Selected(hj).

With this API code I can run through all processes running and look for a match to the one that I'm looking for.
 

Users who are viewing this thread

Back
Top Bottom