System.UnauthorizedAccessException: Access is denied.

Z

Zhuo Li

We are migrating a ASP.net project from XP to windows 7 64 bits.

The asp.net project is using a COM object (32 bits) that retrieves data from
database (Sybase SQL anywhere 11). We are using IIS 7.5.

When it calls a COM object's function to return a plain data type, it works.
However, if it calls the same COM object to return a ADO "recordset", I get
the following error:

System.UnauthorizedAccessException: Access is denied. (Exception from
HRESULT: 0x80070005 (E_ACCESSDENIED))

Please advise if you know anything on this.

Thanks, Zhuo
 
M

Mr. Arnold

Zhuo said:
We are migrating a ASP.net project from XP to windows 7 64 bits.

The asp.net project is using a COM object (32 bits) that retrieves data from
database (Sybase SQL anywhere 11). We are using IIS 7.5.

When it calls a COM object's function to return a plain data type, it works.
However, if it calls the same COM object to return a ADO "recordset", I get
the following error:

System.UnauthorizedAccessException: Access is denied. (Exception from
HRESULT: 0x80070005 (E_ACCESSDENIED))

Please advise if you know anything on this.

Access is denied on what? Accessed is denied to what? Where is the stack
trace?

Anything that works on XP doesn't mean it's going to work on Win 7. And
security implementation on Win 7 is not going to allow the same thing to
happen like it did on the wide open XP O/S.

Access denied means the account being used by the ASP.NET application
usually the ASP.NET worker process account doesn't have the permissions.

It may come done to you may have to do account impersonation using an
account on Win 7 that has the permissions.
 
Z

Zhuo Li

Thank you for your feedback. The stack trace just says access is denied on
the com object.
That doesn't make any sense because I changed the same function inside the
com object to return
any plain data type (widestring, integer) and it works.

I supspect that this is something to do with the ADO assembly and the ADO
being used by com object.

Thanks,
Zhuo
 
M

Mr. Arnold

Zhuo said:
Thank you for your feedback. The stack trace just says access is denied on
the com object.
That doesn't make any sense because I changed the same function inside the
com object to return
any plain data type (widestring, integer) and it works.

I supspect that this is something to do with the ADO assembly and the ADO
being used by com object.

I suspect it's Win 7 security, which is not like XP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top