473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

OleDbConnection Security Exception

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.
Nov 17 '05 #1
2 1422
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

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #2
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

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Job Lot | last post by:
I have written the following function which returns OleDbConnection object. If global variable g_strDbPath contains an invalid file name or path name the catch block throws an error with...
0
by: ecowalker | last post by:
Hello, I've try the following code in the ASPX and it throw a Security Exception in the runtime, but I've try to run on my colleagues machine without any problem. I am using XP Pro and IIS5.1...
0
by: Seth | last post by:
First off, my apologies if this is in the wrong newsgroup, but I hope I'm close enough. I'm trying to do some parsing of a CSV file using OleDbConnection, but for some reason, when I populate my...
3
by: Shreeram Natarajan | last post by:
Hello, Iam developing a sharepoint webpart which needs to read data from an excel file. Iam using OleDbconnection for reading data from excel. However using OleDbconnection object gives the...
0
by: Daniel Conlon | last post by:
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"...
3
by: Ludvig | last post by:
This Exception is executed when using SQLConnection. OleDbConnection connects fine. System.EnterpriseServices.Platform.Initialize() +503...
0
by: Petemo94 | last post by:
Folks, I am getting a "sporadic" exception that contains the following stack trace. I say sporadic b/c my DB connection usually works fine, but occasionally it fails. *** I also noted that...
5
by: CyberLotus | last post by:
Hi, I've created a web application and through this I want to import Excel data to database. Following is the code that I've written, ...
2
by: dmateer | last post by:
I have the following code in an asp.net page: System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection(); cn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.