This is the root class for WebSphere MQ Automation Classes for ActiveX.
There is always only one MQSession object per ActiveX client process.
An attempt to create a second object creates a second reference to the original object.
New creates a new MQSession object.
Dim mqsess As New MQSession
Set mqsess = New MQSession
Read-only. Returns the WebSphere MQ completion code set by the most recent method or property set issued against any WebSphere MQ object.
It is reset to MQCC_OK when a method or a property set is invoked successfully against any MQAX object.
An error event handler can inspect this property to diagnose the error, without having to know which object was involved.
Using the CompletionCode and ReasonCode in the MQSession object is very convenient for simple error handlers.
Defined in: MQSession class
Data Type: Long
Values:
Syntax:
To get: completioncode& = MQSession.CompletionCode
Read-write. Defines the level of WebSphere MQ error for which MQAX will throw an exception. Defaults to MQCC_FAILED. A value greater than MQCC_FAILED effectively prevents exception processing, leaving the programmer to perform checks on the CompletionCode and ReasonCode.
Defined in: MQSession class
Data Type: Long
Values:
Syntax:
To get: ExceptionThreshold& = MQSession.ExceptionThreshold
To set: MQSession.ExceptionThreshold = ExceptionThreshold$
Read-only. Returns the reason code set by the most recent method or property set issued against any WebSphere MQ object.
An error event handler can inspect this property to diagnose the error, without having to know which object was involved.
Using the CompletionCode and ReasonCode in the MQSession object is very convenient for simple error handlers.
Defined in: MQSession class
Data Type: Long
Values:
Syntax:
To get: reasoncode& =
MQSession.ReasonCode
Read-only. Returns the symbolic name of the latest reason code. For example, "MQRC_QMGR_NOT_AVAILABLE".
Defined in: MQSession class
Data Type: String
Values:
Syntax:
To get: reasonname$ =
MQSession.ReasonName
Creates a new MQGetMessageOptions object.
Defined in: MQSession class
Syntax:
gmo = MQSession.AccessGetMessageOptions()
Creates a new MQMessage object.
Defined in: MQSession class
Syntax:
msg = MQSession.AccessMessage()
Creates a new MQPutMessageOptions object.
Defined in: MQSession class
Syntax:
pmo = MQSession.AccessPutMessageOptions()
Creates a new MQQueueManager object and connects it to a real queue manager by means of the WebSphere MQ client or server. As well as performing a connect, this method also performs an open for the queue manager object.
If successful it sets the MQQueueManager's ConnectionStatus to TRUE.
A queue manager can be connected to at most one MQQueueManager object per ActiveX instance.
If the connection to the queue manager fails, an error event is raised, and the MQSession object's ReasonCode and CompletionCode are set.
Defined in: MQSession class
Syntax:
set qm = MQSession.AccessQueueManager
(Name$)
Parameter:Name$
String. Name of Queue Manager to be connected to.
Resets the CompletionCode to MQCC_OK and the ReasonCode to MQRC_NONE.
Defined in: MQSession class
Syntax:
Call MQSession.ClearErrorCodes()
Returns the name of the reason code with the given numeric value. It is useful to give clearer indications of error conditions to users. The name is still somewhat cryptic (for example, ReasonCodeName(2059) is MQRC_Q_MGR_NOT_AVAILABLE), so where possible errors should be caught and replaced with descriptive text appropriate to the application.
Defined in: MQSession class
Syntax:
errname$ =
MQSession.ReasonCodeName(reasonCode&)
Parameter:reasoncode&
Long. The reason code for which the symbolic name is required.