EsbValidateHCtx

Description

EsbValidateHCtx() validates a specific context handle (hCtx).

Syntax

EssValidateHCtx (hCtx)
ESB_HCTX_ThCtx

Parameters

hCtxThe Essbase API context handle to validate

Return Value

This function returns 0 if the context handle is valid, otherwise it returns an error code to indicate the invalid context handle. Possible reasons for an invalid context handle include the login might have timed out or the user was explicitly logged out by the supervisor.

Notes

Access

This function requires no special access.

Example

	Dim sts As Long
	Dim Count As Integer
	Dim pAccess As Integer

	sts = EsbLogin(hInst, "localhost", "test", "testing", Count, hCtx)
	sts = EsbSetActive(hCtx, "sample", "Basic", pAccess)
	
	' Do something else not related to Essbase
	
	sts = EsbValidateHCtx(hCtx)
	If (sts <> 0) Then
	    'if Context no longer valid, re-login	
	    sts = EsbLogin(hInst, "localhost", "test", "testing", Count, hCtx)
	    sts = EsbSetActive(hCtx, "Sample", "Basic", pAccess)
	End If
	
	'Proceed

See Also

EssLogin()
EssAutoLogin()
EssTerm()