469,628 Members | 1,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Permissions Error When Accessing Access Database

When I attempt to access a Microsoft Access database from my website, I
recieve the following error:

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

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 for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Take note that the description says that this can be fixed by modifying the
configuration file, which I am assuming is referring to the Web.config file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jun 29 '07 #1
3 5424
On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@hotmail.comwrote:
When I attempt to access a Microsoft Access database from my website, I
recieve the following error:

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

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 for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Take note that the description says that this can be fixed by modifying the
configuration file, which I am assuming is referring to the Web.config file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokal...@hotmail.comhttp://www.nathansokalski.com/

Why do you use OleDb for MS Access?

http://msdn2.microsoft.com/en-us/lib...onnection.aspx

An application that creates an instance of the OleDbConnection object
can require all direct and indirect callers to have sufficient
permission to the code by setting declarative or imperative security
demands. OleDbConnection makes security demands using the
OleDbPermission object. Users can verify that their code has
sufficient permissions by using the OleDbPermissionAttribute object.
Users and administrators can also use the Code Access Security Policy
Tool (Caspol.exe) to modify security policy at the computer, user, and
enterprise levels. For more information, see Code Access Security and
ADO.NET.

http://msdn2.microsoft.com/en-us/library/0x4t63kb.aspx

Jun 29 '07 #2
I use OleDb for MS Access because of the namespaces that are included in the
..NET Framework (or that I have ever heard of from third parties)
System.Data.OleDb is the one that is supposed to be used when accessing a MS
Access database. The reason I am using MS Access for this website rather
than a higher quality database such as SQL Server or Oracle is because the
organization the site is for cannot afford anything else.

I have used System.Data.OleDb for MS Access databases in other sites I have
written, such as my personal website, with no problem, and any books that I
have read that use MS Access as their example database have as well, so I
know that it is the right one to use.

I have never had to deal with any of the objects you mention (except for
OleDbConnection, of course). Could you please either give me a code sample
or direct me to a site that gives one? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
On Jun 29, 2:50 am, "Nathan Sokalski" <njsokal...@hotmail.comwrote:
When I attempt to access a Microsoft Access database from my website, I
recieve the following error:

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

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 for the
permission of type 'System.Data.OleDb.OleDbPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Take note that the description says that this can be fixed by modifying
the
configuration file, which I am assuming is referring to the Web.config
file.
I have successfully run this application on my machine using Visual Studio
2005's Development Server with the settings currently in the Web.config
file, so if modifying the Web.config file will fix it, what do I need to
change? Thanks.
--
Nathan Sokalski
njsokal...@hotmail.comhttp://www.nathansokalski.com/

Why do you use OleDb for MS Access?

http://msdn2.microsoft.com/en-us/lib...onnection.aspx

An application that creates an instance of the OleDbConnection object
can require all direct and indirect callers to have sufficient
permission to the code by setting declarative or imperative security
demands. OleDbConnection makes security demands using the
OleDbPermission object. Users can verify that their code has
sufficient permissions by using the OleDbPermissionAttribute object.
Users and administrators can also use the Code Access Security Policy
Tool (Caspol.exe) to modify security policy at the computer, user, and
enterprise levels. For more information, see Code Access Security and
ADO.NET.

http://msdn2.microsoft.com/en-us/library/0x4t63kb.aspx
Jun 29 '07 #3
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@c77g2000hse.googlegr oups.com...
Why do you use OleDb for MS Access?
How else would you expect to use a Jet database within the .NET
Framework...???
--
http://www.markrae.net

Jun 29 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Shelly | last post: by
reply views Thread by Fran Tirimo | last post: by
2 posts views Thread by dimstthomas | last post: by
6 posts views Thread by Fred W. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.