?
Solved

COM+ permission denied message box

Posted on 2003-10-31
3
Medium Priority
?
1,149 Views
Last Modified: 2009-07-29
i have a vb dll hosted in COM+.

I have set up role based security on COM+.

When a user trys to connect to the dll and they are not in the relevant group.

A message is generated to the client - "Permission Denied"


--------------------------------------------------------------
What i want to know is:

Can i Customise this message and the message box title?


thanks
0
Comment
Question by:MrKevorkian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:cero
ID: 9660355
Hi MrKevorkian,

The simplest method to personalize the message is:
1. Create a error handler (in the client of the component)
2. in the handler test if the err.number is 70 (permission denied), if this is the case
use a personalized message.




Private Sub Command1_Click()
    Dim obj As Object
    On Error GoTo errh
   
    Set obj = CreateObject("proyecto1.class1")
    obj.DemoMethod
 
    Set obj = Nothing
   
    Exit Sub
errh:
    MsgBox Err.Number & " " & "My personalized message"
End Sub


regards,
cero
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 9660411
I don't think this is an error you can handle in your component as the system has determined rights prior to launching the component.  This is a system generic prompt and I don't know of a way to change it.
0
 
LVL 2

Accepted Solution

by:
cero earned 400 total points
ID: 9660485
AzraSound is right, you can't handle this in the component, but as I mention in my previous comment, you have to do that in the client of the component.

cero.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question