Access Denied while creating an object 
Author Message
 Access Denied while creating an object

Hi,

I already gave full access to the directory where COM object resides.
COM object has been created in VB6. It is using Apartment threaded
model.
Please help:

Server Error in '/HREmergency' Application.
--------------------------------------------------------------------------------

Access is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is
denied.

The ASP.NET process is not authorized to access the requested
resource. For security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider
granting access rights to the resource to the ASP.NET process
identity.

To grant ASP.NET write access to a file, right-click the file in
Explorer, choose "Properties" and select the Security tab. Click "Add"
to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account,
and check the Write box in the Allow column.

Source Error:

Line 14: Dim Logon as Integer
Line 15:
Line 16: oInterActLog = Server.CreateObject("InterActLog.Logon")
Line 17: 'oInterActLog=CreateObject("Excel.Application")
Line 18: 'oInterActLog=Server.CreateObject("Acme.Component.3")

Source File: c:\inetpub\wwwroot\HREmergency\WebForm1.aspx    Line: 16

Stack Trace:

[UnauthorizedAccessException: Access is denied.]
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
   System.Web.HttpServerUtility.CreateObject(String progID) +98
   ASP.WebForm1_aspx.__Render__control1(HtmlTextWriter __output,
Control parameterContainer) in
c:\inetpub\wwwroot\HREmergency\WebForm1.aspx:16
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Page.ProcessRequestMain() +1900



Wed, 12 Jan 2005 00:33:38 GMT  
 Access Denied while creating an object

Hi,

I already gave full access to the directory where COM object resides.
COM object has been created in VB6. It is using Apartment threaded
model.
Please help:

Server Error in '/HREmergency' Application.
--------------------------------------------------------------------------------

Access is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

I would start here:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q286198&

If your component calls the LogonUser API function call:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q223334&


Microsoft MVP (Visual Basic)



Wed, 12 Jan 2005 02:39:49 GMT  
 Access Denied while creating an object
Thanks a lot for the information. I gave full access to my c drive to
Everyone. I'm not accessing any API function, I'm using RDO to access
SQL Server. I also gave full rights to all registry keys to ASP account.

Any idea ? Please help.  

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 14 Jan 2005 22:06:39 GMT  
 Access Denied while creating an object

I tried Filemon, but it does not look like it is a problem with a file
access. I could not find the problem in Filemon.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 14 Jan 2005 23:01:42 GMT  
 Access Denied while creating an object
I found this message somewhere on the web:

"...My default the ASP.NET Worker process does not have access to create
out
of proc DCOM components (regardless of which directory they access). To
grant permissions you should run "dcomcnfg" and grant the Microsoft
Excel Application launch permissions for the "ASPNET" user account..."

I noticed that my Active X component does not show in dcomcnfg. Does it
mean that maybe there is something wrong with it ? However I set
defaults to allow everyone launch Active X component.

Is it possible that my installation was not complete ? I did not have
Windows Component Update CD. Where can I get it ?

Please help. Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 14 Jan 2005 23:39:19 GMT  
 Access Denied while creating an object

I found this message somewhere on the web:


"...My default the ASP.NET Worker process does not have access to create
out
of proc DCOM components (regardless of which directory they access). To
grant permissions you should run "dcomcnfg" and grant the Microsoft
Excel Application launch permissions for the "ASPNET" user account..."


I noticed that my Active X component does not show in dcomcnfg. Does it
mean that maybe there is something wrong with it ? However I set
defaults to allow everyone launch Active X component.

It sounds like the component has not been registered. Have you tried re-registering? Is the
component running in COM+?


Microsoft MVP (Visual Basic)



Sat, 15 Jan 2005 03:22:05 GMT  
 Access Denied while creating an object
Thanks for your help.

Actually it is Active X developed in VB 6. It worked fine in ASP, but in
ASP.NET does not seem to be working. How can I check if it is COM+ ? I
have no idea. Below is the source code for the Active X component:

Function Logon(ByVal strUserID As String, strPassword As String) As Long
Dim strSQL As String

'Create RDO Connection

Dim rs As rdoResultset
Dim cn As New rdoConnection
Dim intListingID As Integer

'Dim qd As New rdoQuery
'Dim cl As rdoColumn
Const None As String = ""

'create DSN less connection
cn.Connect = "uid=sa;pwd=;server=JANUS;" _
    & "driver={SQL Server};database=interaction;" _
    & "DSN='';"
cn.CursorDriver = rdUseOdbc
cn.EstablishConnection rdDriverNoPrompt

'Retrieve Information from database and validates login

'Check User ID
strSQL = "select listing_id from int_aux_lst_custom where"
strSQL = strSQL & " lst_custom_def_id = 637 and string_value = "
strSQL = strSQL & "'" & strUserID & "'"

Set rs = cn.OpenResultset(strSQL, rdOpenForwardOnly, _
                        rdConcurReadOnly)

If rs.BOF And rs.EOF Then
    Logon = -1
    GoTo fnd
End If

intListingID = rs![listing_id]

'Check User Password
strSQL = "select listing_id from int_aux_lst_custom where"
strSQL = strSQL & " lst_custom_def_id = 66 and string_value = "
strSQL = strSQL & "'" & strPassword & "'"
strSQL = strSQL & " AND listing_id = '" & intListingID & "'"

Set rs = cn.OpenResultset(strSQL, rdOpenForwardOnly, _
                        rdConcurReadOnly)

If rs.BOF And rs.EOF Then
    Logon = -2
    GoTo fnd
End If

'Otherwise success
Logon = intListingID

fnd:

rs.Close
cn.Close

End Function

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 15 Jan 2005 04:14:29 GMT  
 Access Denied while creating an object


Thanks for your help.

Actually it is Active X developed in VB 6. It worked fine in ASP, but in
ASP.NET does not seem to be working. How can I check if it is COM+ ? I
have no idea. Below is the source code for the Active X component:

Does the ASP.NET app require authentication or is it set up for anonymous
access?

See the following:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q278013&


Microsoft MVP (Visual Basic)



Sun, 16 Jan 2005 00:47:00 GMT  
 Access Denied while creating an object
Man, you are a genius. It worked !!!!!!!!!!!!!

I just can noty understand if I gave full access to EVERYONE to my C
drive, why do I need to give it again to vb runtime dll? It really looks
like a bug. Should not the permisions be inherited ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 16 Jan 2005 05:22:17 GMT  
 Access Denied while creating an object

Man, you are a genius. It worked !!!!!!!!!!!!!

I just can noty understand if I gave full access to EVERYONE to my C
drive, why do I need to give it again to vb runtime dll? It really looks
like a bug. Should not the permisions be inherited ?

Not exactly sure what might have happened, but I think the security on the runtime file was
overriding the permissions you granted to Everyone. Either that or the IIS anonymous user account
still didn't have sufficient permissions. This stuff is tough to troubleshoot when it's not sitting
there right in front of you.

BTW, I ran into this problem a couple weeks ago when a component was installed on our server with
the VB Setup Program (it is a bug). I personally don't use it to install anything on a server.


Microsoft MVP (Visual Basic)



Mon, 17 Jan 2005 03:05:47 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. XP SP1 Access denied to Objects, Object events not registered

2. Permission denied when creating object

3. Permission Denied when creating Object

4. Can't create object : permission denied

5. Scheduled WinAt\VB6\Create Excel object\Permission denied

6. Permission denied when creating ActiveX EXE object

7. Scheduled WinAt\VB6\Create Excel object\Permission denied

8. Excel Object - Access Denied

9. "Access denied" on document.LastModified Object

10. Permission denied accessing request object from VB IDE

11. Access Denied when creating OCA, from a OCX

12. Access denied when creating ActiveX component

 

 
Powered by phpBB® Forum Software