Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Permissions Error When Accessing Access Database

Reply
Thread Tools

Permissions Error When Accessing Access Database

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-29-2007
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      06-29-2007
On Jun 29, 2:50 am, "Nathan Sokalski" <(E-Mail Removed)> wrote:
> 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
> (E-Mail Removed)://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

 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-29-2007
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
(E-Mail Removed)
http://www.nathansokalski.com/

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
On Jun 29, 2:50 am, "Nathan Sokalski" <(E-Mail Removed)> wrote:
> 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
> (E-Mail Removed)://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


 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      06-29-2007
"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
In-depth documenation on User Permissions, Group Permissions, ACLs, DCLs etc. Curt K ASP .Net 0 11-03-2006 04:54 PM
ASPX file returning obscur runtime error - after changing permissions to a subweb (.net app) to different permissions than on its parent ? Isabelle ASP .Net 0 08-11-2004 02:04 PM
Re: Permissions - giving "everyone" full permissions is bad ? Scott Allen ASP .Net 0 07-13-2004 08:54 PM



Advertisments