Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQCONN and Visual Basic

Status
Not open for further replies.

grasupt

MIS
Jun 14, 1999
13
0
0
US
I keep hearing from my staff that the standard MQCONN function fails to connnect. We are using the 5.2 client software and the COM library included with it.

Any thoughts, outside of my people don't know what they are doing?
 
If they're using the VB samples that came with MQ, my first thought is that the queue manager is not set up properly.

They should also check out the CompCode and ReasonCode in the Application Programming Reference Summary & Application Programming Reference.

If the CompCode is MQCC_WARNING, that just means the Queue Manager is already connected.

Also, are they initializing all of the defaults?
Call MQ_SETDEFAULTS

Hope this helps. There could be a couple of other things that could cause problems, but more info would be needed. It definitely is possible to connect using VB and the samples IBM provides.
 
What exactly is your error?
Have you been using this in production and it's suddenly failing? Or are you developing your programs now and having difficulties connecting?

Your question and response are too vague to give you any sure answers.

When I read your question, it appeared that this was a development issue. If your people are developing from scratch, with the little info you provided, it is difficult to make any suggestions. However, the samples IBM provides can be used as a resource for developing production code. If your people are in the development phase and using these samples, I felt I might be able to make a few suggestions on what the issue might be. If they are in development and have not tried to use the samples, I would strongly recommend they give the samples a look if they cannot connect.

If you provide more info on the actual errors that are occuring and whether the code has ever worked, I'll try to help.
 
Use this snippet of code to popup a helpful error message:
Code:
 Dim MQsess As MQSession 
 Dim MQmgr As MQQueueManager

 MQsess.ExceptionThreshold = 9999 ' Manual error handling
 Set MQmgr = MQsess.AccessQueueManager("MYQUEUEMANAGER")
 Select Case MQsess.CompletionCode
 Case MQCC_OK, MQCC_WARNING
        MsgBox "MQ Connect Successful!"
 Case Else
        MsgBox "MQ Connect Failed: " + MQsess.ReasonName
 End Select
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top