I have a VB 6.0 Dll, which puts & gets messages from a MqSeries Queue. I use the following code to open a queue.
_________________________________________________________
Private Sub OpenConnectionToQueueServer(CompCode As Long, strMsg As String)
On Error GoTo ErrorHandler
Dim Reason As Long 'reason code
' Dim ptions As Long 'open options
' Dim od As MQOD 'object descriptor
' Dim cnocd As MQCNOCD 'connect / channel definition
strMsg = "Open Connection To Queue Server:"
If gHcon = 0 Then
MQCNOCD_DEFAULTS cnocd
cnocd.ChannelDef.ChannelName = mstrQChannel
cnocd.ChannelDef.TransportType = MQXPT_TCP
cnocd.ChannelDef.QMgrName = mstrQmgr
cnocd.ChannelDef.ChannelType = MQCHT_CLNTCONN
cnocd.ChannelDef.ConnectionName = mstrQSvrnme
'connect to the specified Queue Manager
MQCONNXAny cnocd.ChannelDef.QMgrName, cnocd, gHcon, CompCode, Reason
PutRCMsg (Reason)
If CompCode = MQCC_WARNING Or CompCode = MQCC_OK Then
CompCode = 0
strMsg = strMsg & " OpenConnectionToQueueServer Connection Succeeded"
Else
'problem connecting
CompCode = 1
strMsg = strMsg & " OpenConnectionToQueueServer Connection Failed ReasonCode-" & mstrQReason
End If
Else
CompCode = -1
strMsg = strMsg & " Application Error"
End If
Exit Sub
ErrorHandler:
CompCode = -1
strMsg = strMsg & " Runtime Error"
Err.Raise Err.Number
End Sub
____________________________________________________________
The problem I have is whenever I send a request I get a response, but if I immediately try to resend the same request I get a MQRC_Q_MGR_NAME_ERROR = 2058 error although none of the values have changed. Any help is highly appreciated.
Thanks,
-Arak-
_________________________________________________________
Private Sub OpenConnectionToQueueServer(CompCode As Long, strMsg As String)
On Error GoTo ErrorHandler
Dim Reason As Long 'reason code
' Dim ptions As Long 'open options
' Dim od As MQOD 'object descriptor
' Dim cnocd As MQCNOCD 'connect / channel definition
strMsg = "Open Connection To Queue Server:"
If gHcon = 0 Then
MQCNOCD_DEFAULTS cnocd
cnocd.ChannelDef.ChannelName = mstrQChannel
cnocd.ChannelDef.TransportType = MQXPT_TCP
cnocd.ChannelDef.QMgrName = mstrQmgr
cnocd.ChannelDef.ChannelType = MQCHT_CLNTCONN
cnocd.ChannelDef.ConnectionName = mstrQSvrnme
'connect to the specified Queue Manager
MQCONNXAny cnocd.ChannelDef.QMgrName, cnocd, gHcon, CompCode, Reason
PutRCMsg (Reason)
If CompCode = MQCC_WARNING Or CompCode = MQCC_OK Then
CompCode = 0
strMsg = strMsg & " OpenConnectionToQueueServer Connection Succeeded"
Else
'problem connecting
CompCode = 1
strMsg = strMsg & " OpenConnectionToQueueServer Connection Failed ReasonCode-" & mstrQReason
End If
Else
CompCode = -1
strMsg = strMsg & " Application Error"
End If
Exit Sub
ErrorHandler:
CompCode = -1
strMsg = strMsg & " Runtime Error"
Err.Raise Err.Number
End Sub
____________________________________________________________
The problem I have is whenever I send a request I get a response, but if I immediately try to resend the same request I get a MQRC_Q_MGR_NAME_ERROR = 2058 error although none of the values have changed. Any help is highly appreciated.
Thanks,
-Arak-