|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| [Solved] What MQOpen options needed for MQSet? | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | RatherBeGolfing | 
			  
				|  Posted: Tue Mar 16, 2004 11:07 am    Post subject: [Solved] What MQOpen options needed for MQSet? |   |  |  
		  |  Centurion
 
 
 Joined: 12 Nov 2002Posts: 118
 Location: Syracuse, NY, USA
 
 | 
			  
				| I have a developer who is trying to alter the MQIA_INHIBIT_PUT attribute of a QAlias using MQSet through VBScript.    We're running MQ5.3 with CSD04 in a Windows 2000 environment. 
 He's failing because he's not setting the proper Open options.   I've looked in the manuals and can't find where we should be setting anything other than MQOO_Set.
 
 Any advice?
 _________________
 Cheers,
 Larry
 MQ Certifiable
 |  |  
		  | Back to top |  |  
		  |  |  
		  | clindsey | 
			  
				|  Posted: Tue Mar 16, 2004 11:25 am    Post subject: |   |  |  
		  | Knight
 
 
 Joined: 12 Jul 2002Posts: 586
 Location: Dallas, Tx
 
 | 
			  
				| Larry, 
 I don't have any vb code but this works for me in C.
 I verified it works on an alias as well.
 
 
 
   
	| Code: |  
	| oOptions = MQOO_SET |
 MQOO_FAIL_IF_QUIESCING;
 
 MQOPEN(hCon, &od, oOptions, &hObj, &compCode, &reason);
 
 /* prepare to report error if it failed */
 if (compCode != MQCC_OK)
 {
 printf("MQOPEN ended with reason code %d\n", reason);
 }
 else
 {
 
 switch (option)
 {
 case 1: // GET enable
 Select[0] = MQIA_INHIBIT_GET;   /* attribute selector       */
 IAV[0]    = MQQA_GET_ALLOWED; /* attribute value          */
 break;
 
 case 2: // PUT enable
 Select[0] = MQIA_INHIBIT_PUT;   /* attribute selector       */
 IAV[0]    = MQQA_PUT_ALLOWED; /* attribute value          */
 break;
 }
 
 MQSET(hCon,            /* connection handle               */
 hObj,                  /* object handle                     */
 1,                       /* Selector count                    */
 Select,                /* Selector array                    */
 1,                       /* integer attribute count         */
 IAV,                   /* integer attribute array         */
 0,                      /* character attribute count      */
 NULL,                 /* character attribute array      */
 &compCode,       /* completion code                  */
 &reason);           /* reason code                        */
 
 |  
 MQOO_FAIL_IF_QUIESCING is optional so just MQOO_SET should be ok.
 
 What is the reason code you get  and is it on the open or the set call.
 
 Charlie
 |  |  
		  | Back to top |  |  
		  |  |  
		  | RatherBeGolfing | 
			  
				|  Posted: Wed Mar 17, 2004 7:55 am    Post subject: |   |  |  
		  |  Centurion
 
 
 Joined: 12 Nov 2002Posts: 118
 Location: Syracuse, NY, USA
 
 | 
			  
				| Thanks Charlie, once our developer took a look at your code snip, something clicked and he was able to correct the situation we were having. Appreciate you taking the time to share with us!
 _________________
 Cheers,
 Larry
 MQ Certifiable
 |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | 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
 
 |  |  |  |