can't get my vb6 project to run with MQ

Posted on 2009-04-08
Medium Priority
Last Modified: 2012-05-06
I'm trying to write a VB6 project that uses mqax200.dll.  I have sample code from IBM that looks very solid, but the VB6 project won't run.  The variable declarations work fine, but I get an "automation error" when I try to run the project.  I have the mqax200.dll on the reference list.  I assume something else needs to be on my reference list, but what???  Thanks in advance for your help.
Private Sub Main()
    Dim qMgr As MQQueueManager
    Dim mqSess As New MQSession
    Dim inputMsg As New MQMessage
    Dim inputOptions As New MQGetMessageOptions
    Dim inputQueue As MQQueue
    Dim outputMsg As New MQMessage
    Dim outputQueue As MQQueue
    'Create a session, connect to Queue Manager
    Set qMgr = mqSess.AccessQueueManager("QMNT")
    'Open input and output queues
    Set inputQueue = qMgr.AccessQueue("AS400.To.NT", _
                                      MQOO_INPUT_AS_Q_DEF + _
                                      MQOO_FAIL_IF_QUIESCING + _
    Set outputQueue = qMgr.AccessQueue("NT.To.AS400", _
                                       MQOO_OUTPUT + _
    'Put the customer number into the output message
    outputMsg.CharacterSet = 37
    outputMsg.DataOffset = 0
    outputMsg.WriteString txtCustomerNumber
    'Send the customer number message
    outputQueue.Put outputMsg
    'Set the Get Message Options
    inputOptions.Options = MQGMO_WAIT + _
    inputOptions.WaitInterval = MQWI_UNLIMITED
    inputQueue.Get inputMsg, inputOptions
    'Get message data field values
    With inputMsg
        txtCustomerNumber = .ReadString(6)
        lblDataName = .ReadString(3) + _
                      " " + _
        If Not (Trim(lblDataName) = "NOTFOUND") Then
            lblDataCreditLimit = Format(.ReadString(4), "###0")
            lblDataBalanceDue = Format(CDec(.ReadString(6)) / 100, "###0.00")
            lblDataCreditDue = Format(CDec(.ReadString(6)) / 100, "###0.00")
        End If
    End With
End Sub

Open in new window

Question by:thomsone
  • 2

Expert Comment

ID: 24110106
when do you get this error?

Author Comment

ID: 24110124
At run-time.

Accepted Solution

thomsone earned 0 total points
ID: 24357978
Answered myself.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question