We are moving IBM Websphere MQ to a different server(VB6 app will be in different server).
I need to populate SET Server field.
I am using MQAX200.DLL to connect to MQ.
Please let me know how can i connect to different server from vb6.
Below is the code we are currently using to connect to Queue Manager:
Form1.txtstreamLog_File.WriteLine Date & " " & Time & " STATUS: Attempting to connect to the MQ Queue Manager: " & Form1.strManagerQueueName
Set mconMQ = New MQAX200.MQQueueManager
With mconMQ
'Set the Name of the Queue Manager (or allow to default)
.Name = Form1.strManagerQueueName
'Connect to Queue Manager
.Connect
'Get Connect Method Results & Display
mlngConnectionHandle = .ConnectionHandle
'Check Completion Code
If .CompletionCode <> MQCC_OK Then
Form1.txtstreamLog_File.WriteLine Date & " " & Time & " ERROR: Failed to connect to Queue Manager: " & Form1.strManagerQueueName & vbCr & _
"Reason Code: " & .ReasonCode & vbCr & _
"Reason Text: " & .ReasonName
ConnectQueueManager = False
Exit Function
End If
End With 'mconMQ
Form1.txtstreamLog_File.WriteLine Date & " " & Time & " STATUS: Connected to the Queue Manager successfully"
ConnectQueueManager = True
Exit Function
MQAX200.DLL
is the dll used for IBM MQs depricated Microsoft ActiveX and VB6 connectivity. IBM MQ Classes for .NET are the recommended replacement technology.
Everything I found indicates you can only use the MQSERVER environment variable to provide connection details for a single queue manager or use a MQ Channel Table pointed to by the the MQCHLLIB/MQCHLTAB environment variables if you need to connect to multiple queue managers.
It has been documented in all recent versions of the Knowledge center (v7.0.1 is the oldest I could find) that MQAX (MQ ActiveX) support was stabilized at the IBM WebSphere® MQ Version 6.0 level:
MQ v7.0.1 Knowledge Center Page "Coding in ActiveX":
Support for ActiveX has been stabilized at the WebSphere® MQ Version 6.0 level. To exploit features introduced to WebSphere MQ later than Version 6.0, consider using .NET instead.
MQ v9.0 Knowledge Center Page "Object-oriented applications":
ActiveX
The IBM MQ ActiveX is commonly known as the MQAX. The MQAX is included as part of IBM MQ for Windows. Support for ActiveX has been stabilized at the IBM WebSphere® MQ Version 6.0 level. To exploit features introduced to IBM MQ later than Version 6.0, consider using .NET instead. Refer to Using the Component Object Model Interface (WebSphere MQ Automation Classes for ActiveX) for information about coding programs using the IBM MQ Object Model in ActiveX.
In addition IBM in the "IBM MQ V9.0 Software Announcement" has stated:
Function that is removed in IBM MQ V9.0
IBM MQ support for Microsoft ActiveX and VB6
IBM MQ support for Microsoft ActiveX and VB6 is deprecated. IBM MQ Classes for .NET are the recommended replacement technology.
In summary the interface you are using has been stabilized and has not been enhanced since IBM MQ v6.0 released in June 2005 and has only had defect fixes. In v9.0 it has been deprecated which indicates that IBM will remove it from a future release of the product.
Note that you also can not use TLS encryption or pass a username and password to MQ using the Microsoft ActiveX libraries and would be limited in ways to secure your SVRCONN channel from unauthorized connections.
I would suggest that you convert to the .NET libraries. The samples are found under the MQ installation directory in tools\dotnet\samples
.
UPDATE 2017/04/17
IBM MQ v9 Knowledge center page "Deprecated, stabilized and removed features" has now been updated to also reflect that IBM MQ support for Microsoft ActiveX and VB6 is deprecated.
Deprecation of IBM MQ support for MicrosoftActive X and Microsoft Visual Basic 6.0
IBM MQ support for MicrosoftActive X and
Microsoft Visual Basic 6.0 is deprecated. IBM MQ classes for .NET are
the recommended replacement technology. See Using the Component
Object Model Interface (IBM MQ Automation Classes for
ActiveX)
and Coding in Visual
Basic.