Access Denied error while using EnableNotification in MSMQ
I am trying to create a queue listener for MSMQ.
This is the code which i am using to create a queue
Dim Qinfo As New MSMQQueueInfo
Dim Q As MSMQQueue
Dim msg As New MSMQMessage
Dim msgEvent As MSMQEvent
Qinfo.PathName = ".\testqueue"
Qinfo.Label = "Test Queue"
Set msgEvent = New MSMQEvent
Set Q = Qinfo.Open(MSMQ.MQ_SEND_ACCESS, MSMQ.MQ_DENY_NONE)
msg.Label = "Label"
msg.Body = "Help me please"
Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=1000
Private Sub msgEvent_Arrived(ByVal Queue As Object, _
ByVal Cursor As Long)
On Error GoTo msgArrivedErrorHandler
Set Q = Qinfo.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)
Set msg = Q.Receive(ReceiveTimeout:=0)
Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=10000
MsgBox err.Description + " in Arrived event"
But at runtime in Listener sub i am getting error as "Access Denied"
on "Q.EnableNotification Event:=msgEvent, ReceiveTimeout:=1000" line.
Please give me the solution for this error.
Thanks & Regards
Software Elements India Pvt. Ltd.
Suite G-1, Shalimar Building,
216, Marine Drive.
Mumbai - 400 020
Voice: 91 - 22 – 202 6068/202 6114
Web Presence : www.seipl.com
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL