Access denied error. RRS feed

  • Question

  • I've developed a site using ASP.NET with C# and an access database is used by this site. When I run this locally every thing goes smoothly without any error. When I published it on my host I get error saying:

    Server Error in '/' Application.

    Access to path 'SalesPoint.mdb' was denied. The location doesnot exist or is not accessible because of security settings.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Access to path 'SalesPoint.mdb' was denied. The location does not exist or is not accessible because of security settings.

    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.

    Stack Trace:

    [HttpException (0x80004005): Access to path 'SalesPoint.mdb' was denied. The location does not exist or is not accessible because of security settings.] 
    System.Web.HttpRuntime.CheckFilePermission(String path, Boolean writePermissions) +3279250
    System.Web.UI.WebControls.AccessDataSource.GetPhysicalDataFilePath() +178
    System.Web.UI.WebControls.AccessDataSource.get_ConnectionString() +30
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +109
    System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +74
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
    System.Web.UI.WebControls.GridView.DataBind() +4
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
    System.Web.UI.Control.EnsureChildControls() +87
    System.Web.UI.Control.PreRenderRecursiveInternal() +50
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041

    I dont get this error at the first page. I get it when I click the done button to hide the current panels at page and make other panel containing gridview to visible. Although the panel that gets displayed normally has a drop down which gets populated with data from same database. I've checked out host's folder and database security settings. Any idea about what's wrong n how can I get it fixed?

    Friday, July 25, 2008 3:52 AM

All replies

  • Check IIS user access to database directory...

    Good luck!
    Friday, July 25, 2008 5:23 AM
  • You'll need to monkey with Caspol.exe to give ASP.NET permission to access the file.  Post to forums.asp.net for the details.
    Hans Passant.
    Friday, July 25, 2008 1:19 PM