Author |
Message
|
RayC |
Posted: Tue Aug 24, 2010 6:02 am Post subject: MQ Client and VB6 |
|
|
Newbie
Joined: 19 Aug 2010 Posts: 3
|
For about a couple of years now, we've been using a VB6 application to connect to MQ Server, and it's been working
fine. Both the VB6 app and the queue manager were on the same server called SQLPRD2.
Recently, we needed to move the queue manager to another server (AS400) and install MQ Client on SQLPRD2. Now we need
to tell our VB6 app to use MQ Client to fetch the messages from the queue mananger on the AS400.
The IBM documentation says to simply recompile the application by changing the conditional compilation to MqType=2.
Secondly, we changed the usual parameters such as the MQ server name, port, channel etc. Now when we run it, we keep
getting the 2058 error saying it cannot connect to the queue manager.
So we decided to test it by hard-coding some information.
Here is a portion of the VB6 code we're trying to test, but this gives error code 2058:
Dim lngQueueManagerCH As Long
MQCNOCD_DEFAULTS co
co.ChannelDef.ChannelName = "SYSTEM.DEF.SVRCONN"
co.ChannelDef.ConnectionName = "99.9.9.9(1484)"
co.ConnectOpts.ClientConnOffset = 188
MQCONNXAny "MCMQMD1", co, ConnectionQM, lngCompCode, lngReason
Where 99.9.9.9 is the IP address of the AS400.
1484 is the port number.
MCMQMD1 is the queue manager name.
Can anyone tell me what we're doing wrong?
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 24, 2010 6:09 am Post subject: Re: MQ Client and VB6 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RayC wrote: |
co.ConnectOpts.ClientConnOffset = 188
|
Why this?
If you're sure you want to do this, are you sure this value is correct? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Aug 24, 2010 6:10 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9471 Location: US: west coast, almost. Otherwise, enroute.
|
Any errors logged on the as/400? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
RayC |
Posted: Tue Aug 24, 2010 6:12 am Post subject: |
|
|
Newbie
Joined: 19 Aug 2010 Posts: 3
|
Originally, I did not have that line at all. But I found some samples online that had similar problems to ours, and for them, adding this line worked. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 24, 2010 6:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RayC wrote: |
Originally, I did not have that line at all. But I found some samples online that had similar problems to ours, and for them, adding this line worked. |
I suspect you'll need to code the additional construct that offset identifies & change the offset you use accordingly.
As well as the suggestion of my worthy associate, I'd try setting up a tab file & using MQCONN rather than MQCONNX. It'd be interesting (to me at least) to see if that yields the same error. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Aug 24, 2010 4:27 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Is the qmgr listening on the host / port actually named "MCMQMD1" ?
Have you tested the connection? eg.
amqscnxc -x 99.9.9.9(1484) -c SYSTEM.DEF.SVRCONN MQMQMD1
or
set MQSERVER=SYSTEM.DEF.SVRCONN/TCP/99.9.9.9(1484)
amqsputc YOUR.QL.NAME MCMQMD1 _________________ Glenn |
|
Back to top |
|
 |
RayC |
Posted: Wed Aug 25, 2010 4:44 am Post subject: |
|
|
Newbie
Joined: 19 Aug 2010 Posts: 3
|
Strangely enough, when I test it using:
amqscnxc -x 99.9.9.9(1484) -c SYSTEM.DEF.SVRCONN MCMQMD1
I get reason code 2035.
I think this has to do with security.
Here's what's even stranger. I explained the fact that I cannot connect to the queue manager to another developer here who also uses it, and he says his java application does not require a user name or password. He told me he leaves both null, yet his java application connects to the queue manager.
Can someone explain why his java app requires no user name or password? Yet, when I supply no user name or password with my VB app I get reason code 2035. I know for a fact that my VB application runs under a specific account on the server. I asked to have this account added to the server where the queue manager exists (as400) but the admins don't want to do that because they tell me to do like the java developer, where no new account is needed.
Can someone kindly explain why the java app requires no credentials? Yet my VB app gets reason code 2035. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Aug 25, 2010 4:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RayC wrote: |
Can someone kindly explain why the java app requires no credentials? Yet my VB app gets reason code 2035. |
There's a known "feature" with java that's been discussed many, many times on this forum. Because your queue mananger is improperly secured (i.e. using default settings) his Java app is getting administrative authority from a blank user id.
10 minutes with the search facility will turn up a wealth of threads. _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Wed Aug 25, 2010 4:50 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Wed Aug 25, 2010 4:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
RayC wrote: |
Strangely enough, when I test it using:
amqscnxc -x 99.9.9.9(1484) -c SYSTEM.DEF.SVRCONN MCMQMD1
I get reason code 2035. |
So this proves client connection to that queue manager is possible (because the queue manager is returning the security error) which pins the blame firmly on your MQCONNX call.
I repeat my advice to try a normal MQCONN & see what happens. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|