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 » IBM MQ API Support » MQCONN in C

Post new topic  Reply to topic
 MQCONN in C « View previous topic :: View next topic » 
Author Message
mahp
PostPosted: Mon Sep 27, 2004 3:49 am    Post subject: MQCONN in C Reply with quote

Newbie

Joined: 27 Sep 2004
Posts: 4
Location: Bang. India

Hello Friends,

I m trying to connect to Q manager but its going to be fail because of 2058 reason code. I am getting this error in all program even i changed the Q manager names. ITs connect to the same Q mgr in VB program. (windows platform).
but why I m getting this reason code. I tried to connet by API Exerciser which is provided by MQSeries inbuild its connecting and also opening queues and putting and gettting msg all r working fine.
If any buddy knows then please try to help me.
My code is as follows,

main()
{
MQHCONN hConn;
MQLONG Reas_Code;
MQLONG Comp_Code;
//MQCHAR *QMgr_Name="My_QMgr";

printf("Please wait Connecting to Q manager...\n");

MQCONN("My_QMgr" ,&hConn,&Comp_Code ,&Reas_Code );

if( Comp_Code = MQCC_FAILED)
{
CallError("Queue Manager Connection", Comp_Code, Reas_Code );
//exit(0);
return 0;
}

printf("Welcome to the My_QMgr Q Manger\n");

if (Reas_Code != MQRC_ALREADY_CONNECTED)
{
MQDISC(&hConn, &Comp_Code , &Reas_Code );
CallError("Disconnect from Queue Manager", Comp_Code , Reas_Code );
}

return 0;
}

Thanx in advance
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Sep 27, 2004 8:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

All MQ objects are case sensitive. Do you have a queue manager called: "My_QMgr" vs "MY_QMGR" ??

Also, is the queue manager on the same box where you are running the C program. i.e. connecting in binding mode? Or is the queue manager on another box? i.e. connecting in client mode?

If client mode then did you corretly setup the MQSERVER environment variable?? (or MQCHLTAB & MQCHLLIB)

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mahp
PostPosted: Mon Sep 27, 2004 8:13 pm    Post subject: Reply with quote

Newbie

Joined: 27 Sep 2004
Posts: 4
Location: Bang. India

Ya i have queue manager called "My_QMgr" .
Actualy i installed server not client on my local machine, and trying to execut the all program localy.
I didn't set any MQSERVER enviornmet variable, where should i set up these ENV variables i.e. MQCHLTAB & MQCHLLIB.
Please tell me.
Thanx very much Roger.
_________________
Regards
mahp
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Sep 27, 2004 8:25 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

You don't need MQSERVER, MQCHLTAB or MQCHLLIB environment variables if your appl. is connecting in binding mode.

What libraries did you link with the C program? i.e. mqm.lib or mqic32.lib
- For binding mode, you must link with mqm.lib
- For client mode, you must link with mqic32.lib

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mahp
PostPosted: Mon Sep 27, 2004 9:11 pm    Post subject: Reply with quote

Newbie

Joined: 27 Sep 2004
Posts: 4
Location: Bang. India

Hi
see if i link mqic32.Lib this library it gives me 2058 reasoncode for fail,
and if i link mqm.lib then it gives me 2059 reason code for fail
Thanx Roger
_________________
Regards
mahp
Back to top
View user's profile Send private message
siliconfish
PostPosted: Mon Sep 27, 2004 9:37 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

Check if your queue manager is Running? BTW if u are using the server use mqm.lib
Back to top
View user's profile Send private message
mahp
PostPosted: Mon Sep 27, 2004 10:01 pm    Post subject: Reply with quote

Newbie

Joined: 27 Sep 2004
Posts: 4
Location: Bang. India

Hi
Queue Manager is running . Now if i link mqic32.Lib this library it gives me 2058 reasoncode for fail,
and if i link mqm.lib then it gives me 0 reason code and CC to be fail
and using VB program its connecting to the same Queue manager but not in C program.
Thanx
_________________
Regards
mahp
Back to top
View user's profile Send private message
siliconfish
PostPosted: Mon Sep 27, 2004 10:29 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

Looks like your program is working fine in binding mode, try putting a message and test.
If u want to use the client libraries u must set MQSERVER environment variable.
If you read MQseries Clients manual u will have more info regarding the client setup and when u would need a client.
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 » IBM MQ API Support » MQCONN in C
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.