Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/04/2005, 10:22
Avatar de jeancarle
jeancarle
 
Fecha de Ingreso: junio-2004
Mensajes: 37
Antigüedad: 20 años, 8 meses
Puntos: 0
Como cambiar el application's trust level

Hola Amigos del foro,

Quisiera saber si hay alguna forma de cambiar las políticas de seguridad de un sitio hecho en ASP.NET desde el archivos de configuración. Esto lo necesito porque cuando intento accesar a una base de datos de MS Access me marca un error de seguridad y quiero cambiar las políticas de seguridad de la aplicación para que me permita consultar la base de datos.

Este es el error que me marca la aplicación:

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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



Y el código para acceso a la BD de Access es:
Código:
     dim cnn as Oledb.OledbConnection
     dim strConnection as string
     strConnection = "PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=C:\Domains\mysite.com.mx\wwwroot\database\mydatabase.mdb;Jet OLEDB:Database Password=mypass;"
     cnn = new Oledb.OledbConnection(strConnection)
     cnn.open()
     response.Write("Conexion Exitosa")
     cnn.close()
     cnn = nothing
He intentado poner esto en el web.config pero me marca un Runtime Error:
Código:
<trust level="Full" originUrl="/" />
Y tambien:
Código:
<securityPolicy>
   <trustLevel name="Full" policyFile="internal" />   
</securityPolicy>
y me marca el Runtime Error. Por favor si alguien me puede ayudar o si alguien sabe donde encuentro información acerda de esto.

Gracias de antemano, y saludos a todos.
__________________
Todo es mas sencillo de lo que parece... :-)

Última edición por jeancarle; 07/04/2005 a las 10:27