添加服务器详细信息以连接到 VB6 中的 IBM Websphere MQ 系列

Add Server Details to connect to IBM Websphere MQ series in VB6

我们正在将 IBM Websphere MQ 移动到不同的服务器(VB6 应用程序将在不同的服务器中)。 我需要填充 SET Server 字段。 我正在使用 MQAX200.DLL 连接到 MQ。

请告诉我如何从 vb6 连接到不同的服务器。

下面是我们当前用于连接到队列管理器的代码:

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 是用于 IBM MQs depricated Microsoft ActiveX 和 VB6 连接的 dll。 IBM MQ 类 for .NET 是推荐的替代技术。


我发现的一切都表明您只能使用 MQSERVER 环境变量为单个队列管理器提供连接详细信息,或者使用 MQCHLLIB/MQCHLTAB 环境变量指向的 MQ 通道 Table 如果您需要连接到多个队列管理器。


知识中心的所有最新版本(v7.0.1 是我能找到的最旧版本)都记录了 MQAX (MQ ActiveX) 支持在 IBM WebSphere® MQ 版本 6.0 级别稳定: MQ v7.0.1 知识中心页面“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 知识中心页面“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.


此外 IBM 在“IBM MQ V9.0 Software Announcement”中声明:

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.


综上所述,您使用的界面自 2005 年 6 月发布 IBM MQ v6.0 以来一直稳定且未增强,仅修复了一些缺陷。在 v9.0 中它已被弃用,这表明 IBM 将从产品的未来版本中删除它。

请注意,您也不能使用 TLS 加密或使用 Microsoft ActiveX 库将用户名和密码传递给 MQ,并且在保护 SVRCONN 通道免受未经授权连接的方式方面会受到限制。


我建议您转换为 .NET 库。示例位于 tools\dotnet\samples.

中的 MQ 安装目录下

更新 2017/04/17

IBM MQ v9 知识中心页面“Deprecated, stabilized and removed features”现已更新,以反映 IBM MQ 对 Microsoft ActiveX 和 VB6 的支持已弃用.

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.