OleDbConnection Security Exception

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.
 
W

Wim Hollebrandse

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top