Pid of the progress current session

lucas.godoi

New Member
How I can get de PID (process Id) of the current session of progress?
How I can get de PID store in the field "_connect._connect-pid", of the virtual system table "_connect", of progress?
 
Windows?

KB p6250

http://tinyurl.com/94x72


DEFINE VARIABLE intProcessHandle AS INTEGER NO-UNDO.

PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
END PROCEDURE.

RUN GetCurrentProcessId (OUTPUT intProcessHandle).

MESSAGE "Process ID = " intProcessHandle VIEW-AS ALERT-BOX.


See also the KB entry referenced within.

Lee
 

lucas.godoi

New Member
Thank you for your help with Pid of current session. It's ok.

Now, you know how I get the computer name, in windows 98?

Since now I have Id-connection, I still need the computer name to set the field "_connect._connect-device" with the correct value.

Thank you.
 

Kirmik

Member
Lee Curzon said:
Windows?

KB p6250

http://tinyurl.com/94x72


DEFINE VARIABLE intProcessHandle AS INTEGER NO-UNDO.

PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
END PROCEDURE.

RUN GetCurrentProcessId (OUTPUT intProcessHandle).

MESSAGE "Process ID = " intProcessHandle VIEW-AS ALERT-BOX.


See also the KB entry referenced within.

Lee

Surely this will only give the PID on where the code is run so unless you run that code directly on the server the PID wont match that of the one recorded in the database?
 
I know what you are saying, and I had made the assumption myself that the windows PID would not mean anything to a database running on another server (possibly Unix). However, looking at the contents of the connect table, it appears that the processID is that issued by whatever OS the connecting process is running on. This makes sense when you bear in mind there are different connect types (SELF/REMOTE/etc.) stored in _connect-type. It is also necessary for any linking of information between client processes and the database.

I think if you were connecting via a server process you would look at the _servers table (via _connect._connect-server) for the server process id.

Unfortunately I do not have time at the mo to test this hypothesis - perhaps someone better informed can comment.

Also, see:
KB P13264
Title: "How do you discover what users are using an _mprosrv.exe."

http://tinyurl.com/b6ern
 
Top