Hi,
1. In V8 you can use the GetCurrentProcessId API call to retreive the PID and find your _Connect record. Example:
DEFINE VARIABLE intProcessHandle AS INT NO-UNDO.
PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
END PROCEDURE.
RUN GetCurrentProcessId (OUTPUT intProcessHandle).
FIND FIRST _connect WHERE _connect-pid = intProcessHandle NO-LOCK NO-ERROR.
DISPLAY _connect.
2. In V9 you can use _MyConnection VST. Example:
find first _MyConnection.
display _MyConnection.
Best regards,
Gabor