Update
MSMQQueueInfo

The Update method updates Active Directory (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.

Active Directory (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 of a public queue, some clients may still see the old settings registered in Active Directory after the properties are changed. Changes to Active Directory (such as setting properties) are propagated from domain controller to domain controller, which can cause delays in the availability of new information. Consequently, clients using a specific domain controller may still see the old property settings, even though the settings of the properties 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, 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
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mqoai.h.
  Import Library: Use mqoa.lib.
  Unicode: Defined only as Unicode.

See Also

Create, Label, MSMQQueueInfo, PathName