Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

can't get my vb6 project to run with MQ

Posted on 2009-04-08
3
Medium Priority
?
1,056 Views
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 + _
                                      MQOO_INQUIRE)
 
    
 
    Set outputQueue = qMgr.AccessQueue("NT.To.AS400", _
                                       MQOO_OUTPUT + _
                                       MQOO_FAIL_IF_QUIESCING)
 
    '------------------------------------------------------------
 
    '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 + _
                           MQGMO_CONVERT
 
    
 
    inputOptions.WaitInterval = MQWI_UNLIMITED
 
    
 
    inputQueue.Get inputMsg, inputOptions
 
    
 
 
 
 
 
    '------------------------------------------------------------
 
    'Get message data field values
 
    '------------------------------------------------------------
 
    With inputMsg
 
    
 
        txtCustomerNumber = .ReadString(6)
 
        lblDataName = .ReadString(3) + _
                      " " + _
                      .ReadString(8)
 
        
 
        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

0
Comment
Question by:thomsone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:deepakra79
ID: 24110106
when do you get this error?
0
 

Author Comment

by:thomsone
ID: 24110124
At run-time.
0
 

Accepted Solution

by:
thomsone earned 0 total points
ID: 24357978
Answered myself.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

604 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