ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Connecting to MQManager using MQ client with VBScript

Post new topic  Reply to topic
 Connecting to MQManager using MQ client with VBScript « View previous topic :: View next topic » 
Author Message
kumaramit8
PostPosted: Thu Jan 31, 2013 5:17 am    Post subject: Connecting to MQManager using MQ client with VBScript Reply with quote

Newbie

Joined: 31 Jan 2013
Posts: 4

Hi All,
I am trying to connect to a MQ Server using below code from MQ client machine.I am using excel macro for the same.The code used is:
Set MQSess = CreateObject("MQAX200.MQSession")
Set QMgr = CreateObject("MQAX200.MQQueueManager")
Set QMgr1 = MQSess.AccessQueueManager("Q3T0102")

I am unablt to connect to queuemanager using macro even though with command prompt it is working fine.
Any advise will be highly praised.
Thanks in advance for your help.

Thanks & Regards,
-Amit
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 31, 2013 5:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should be using the .NET classes, unless you are somehow using a version of windows that does not support .NET.

The code you have posted is for the VB interface, not for the VB.NET interface.

You haven't explained what error is returned when it 'doesn't work'.

You haven't explained the steps you have taken to make sure that all of the necessary environment is configured inside Excel so that when the macro is run, it can find the MQ libraries and etc.
Back to top
View user's profile Send private message
kumaramit8
PostPosted: Thu Jan 31, 2013 11:19 am    Post subject: details Reply with quote

Newbie

Joined: 31 Jan 2013
Posts: 4

Error Code 2058 is getting displayed.
Already defined the MQServer system environment variable.Not sure Where am i going wrong.
Any suggestion will be highly praised.
Thanks & Regards,
-Amit
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 31, 2013 11:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

MQRC 2058 means that it can't find the queue manager you've asked for.

Generally with MQSERVER, you don't need to specify the name of a queue manager.

There's no guarantee that any environment variables you have set outside of Excel will be set for processes running inside Excel.

I've never bothered to write an Excel macro, so i can't give you any more specific advice.

Except, again, to use the .NET classes instead of the ActiveX interface.
Back to top
View user's profile Send private message
kumaramit8
PostPosted: Thu Jan 31, 2013 11:34 am    Post subject: Reply with quote

Newbie

Joined: 31 Jan 2013
Posts: 4

MQSERVER=Q3T0102.QTP.T1/TCP/abcd.*.*.*.com(1414)
and the error is:MQAX200.MQSession::AcessQueueManagerCompletionCode=2,Reasoncode=2058,ReasonName = MQRC_Q_MGR_NAME_ERROR
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 31, 2013 11:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kumaramit8 wrote:
MQSERVER=Q3T0102.QTP.T1/TCP/abcd.*.*.*.com(1414)
and the error is:MQAX200.MQSession::AcessQueueManagerCompletionCode=2,Reasoncode=2058,ReasonName = MQRC_Q_MGR_NAME_ERROR


Yes, and your code
Code:

Set QMgr1 = MQSess.AccessQueueManager("Q3T0102")


I would typically expect
Code:
Set QMgr1 = MQSess.AccessQueueManager()

or
Code:
Set QMgr1 = MQSess.AccessQueueManager("*")

where I knew MQSERVEr was in effect.

but again, Just becuase you have set MQSERVER in a shell or in the environment, there's no reason to expect that Excel thinks it is set!

The environment for Excel macros may have ABSOLUTELY NOTHING to do with the shell that launched Excel or the global environment.
Back to top
View user's profile Send private message
kumaramit8
PostPosted: Mon Feb 04, 2013 12:44 am    Post subject: MQ Reply with quote

Newbie

Joined: 31 Jan 2013
Posts: 4

Can somebody help me with this?I really need your help on priority.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Connecting to MQManager using MQ client with VBScript
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.