OleDbConnection Security Exception

  • Thread starter Thread starter Daniel Conlon
  • Start date Start date
D

Daniel Conlon

I wish to allow ASP.NET pages to make connections to Access databases using
OleDBConnection.

The only way I have been able to make this functionality work has been to
set:

Unrestricted="true"

In the <PermissionSet> property applying to ASP.NET pages, otherwise I get:

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: Request failed.

I do not wish to run ASP.NET pages in an unrestricted security policy, I
would be grateful if you could inform me which permissions I must grant to
allow the use of OleDBConnection. I have granted unrestricted
OleDbPermission, FileIOPermission and RegistryPermission but to no avail.
 
Nothing you can do about it.

ASP.NET requires Full Trust in order to allow OleDb, Odbc and OracleClient connections.

From the docs:

"This class is intended for future use when the .NET Framework Data Provider for OLE DB is enabled for partial trust scenarios. The .NET Framework Data Provider for OLE DB currently requires FullTrust permission. At present, using the OleDbPermission class has no effect."

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com
 
Back
Top