Update
MSMQQueueInfo

The Update method updates MQIS (public queues) or the local computer (private queues) with the current property values of the MSMQQueueInfo object.

Syntax

object.Update
 
Syntax Element Description
object The queue information (MSMQQueueInfo) object that defines the public queue.

Remarks

The Update method can only update existing queues. It cannot be called on an MSMQQueueInfo object before the queue is created or after the queue is deleted.

MQIS (public queues) and the local computer (private queues) are not updated when an MSMQQueueInfo property is set. They are only updated when a queue is created, when the queue is opened, and whenever Update is explicitly called.

Update can be used on MSMQQueueInfo objects that define public queues or local private queues. Properties for remote private queues are stored on the computer where the queue exists, and therefore cannot be updated.

The following queue properties may not be available to Update.

Property Name Reason
BasePriority For public queues only. Cannot be set for private queues.
CreateTime Set by MSMQ.
QueueGuid Set by MSMQ.
ModifyTime Set by MSMQ.
PathName Can only be set when the queue is created.

For a complete description of setting queue properties, including a list of the properties that can be set, see Setting a Queue's Properties Using ActiveX Components.

When setting the properties for public queues, some clients may see the old settings registered in MQIS. Changes to MQIS (such as setting queue properties) are propagated from site to site, which can cause delays in viewing the most current information. Consequently, clients in some sites may still see old settings, even though they were changed by Update. Propagation delays, including communication network delays such as down links, are controlled by the MSMQ Administrator.

Example

This example creates a public queue and then uses Update to change the queue's label. To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form that has a single text box, and then run the example and click the form.

Dim qinfo As MSMQQueueInfo

Private Sub Form_Click()
    
  Set qinfo = New MSMQQueueInfo
  qinfo.PathName = ".\UpdateTest"
  qinfo.Label = "Test Queue"
  qinfo.Create
  MsgBox "The queue's label is: " + qinfo.Label
  
  qinfo.Label = "New Queue Label"
  qinfo.Update
  MsgBox "The queue's label is: " + qinfo.Label

End Sub
 

See Also

Create, Label, MSMQQueueInfo, PathName


© 1997 by Microsoft Corporation. All rights reserved.