Error using access .mdb with asp.net on iis 6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ollyb303
    New Member
    • Dec 2007
    • 74

    Error using access .mdb with asp.net on iis 6

    Hi,

    wasn't sure whether I should post this under .net, IIS or access, but I've plumped for .net!

    I have a problem with an asp.net website which I am hosting on a windows server 2003 under IIS 6.0.

    I am using an access database as the datasource for a gridview - this all works fine when I am running it on the development server in VWD 2005 express on my dev machine, but when I've uploaded the site to the server, I get a stack trace when I try to access the page with the gridview on it.

    Code:
    Server Error in '/' Application.
    Disk or network error.
    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.Data.OleDb.OleDbException: Disk or network error.
    
    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:
                                                                                
                                                                                
     [OleDbException (0x80004005): Disk or network error.]                      
                                                                                
     System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARA 
     MS dbParams, Object& executeResult) +267                                   
        System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&               
     executeResult) +192                                                        
        System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, 
     Object& executeResult) +48                                                 
        System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior    
     behavior, String method) +106                                              
        System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)  
     +111                                                                       
                                                                                
     System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(Comman 
     dBehavior behavior) +4                                                     
        System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,          
     DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String        
     srcTable, IDbCommand command, CommandBehavior behavior) +141               
        System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32            
     startRecord, Int32 maxRecords, String srcTable, IDbCommand command,        
     CommandBehavior behavior) +137                                             
        System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) 
     +83                                                                        
                                                                                
     System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelect 
     Arguments arguments) +1770                                                 
                                                                                
     System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect(DataSourceSel 
     ectArguments 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.Control.PreRenderRecursiveInternal() +170                 
        System.Web.UI.Page.ProcessRequestMain(Boolean                           
     includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041 
                                                                                
                                                                                
    
    
    
    
    Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
    ASP.NET Version:2.0.50727.1433
    I've looked this up on MSDN, google, etc and have found several possible solutions, none of which have worked (changed environment variables for TMP and TEMP, ensured IIS anon account has access to temp folder, etc.) - I still get the same error...

    I've never used an access db in this way before so this is pretty new to me - what could cause this? Is it because I don't have access on the server?? Could it be because my .mdb uses linked tables which link to another .mdb on our network? Am I missing something obvious?

    I know my code works because it's working on the dev server... Here's the code for my Gridview:

    Code:
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderColor="Yellow"
                BorderStyle="Solid" BorderWidth="2px" DataSourceID="AccessDataSource1" Font-Names="Verdana"
                Font-Size="Small" ForeColor="Black">
                <Columns>
                    <asp:BoundField DataField="Manager" HeaderText="Manager" SortExpression="Manager" />
                    <asp:BoundField DataField="Advisor_Name" HeaderText="Advisor Name" SortExpression="Advisor_Name" />
                </Columns>
            </asp:GridView>
           
            <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/TeamLists.mdb"
                SelectCommand="SELECT [Manager], [Advisor Name] AS Advisor_Name FROM [TeamAndrew]">
            </asp:AccessDataSource>
    I'm starting to tear my hair out here... please can someone help me??

    Many thanks,

    Olly
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    I would put my bet on the persmission set the application has on the access file. Not really sure on how to set this, if it can be done from code or from IIS itself

    Comment

    • ollyb303
      New Member
      • Dec 2007
      • 74

      #3
      Originally posted by Shashi Sadasivan
      I would put my bet on the persmission set the application has on the access file. Not really sure on how to set this, if it can be done from code or from IIS itself
      I don't think that's it... I have allowed full control access to the file for both "Everyone" and the IUSR anonymous IIS account - I have set these permissions on both the file itself and the directory through the file system on the server and on the the directory via IIS - I don't have the option of setting permissions on the file itself through IIS. I'm sure I'm allowing as much access to the file as I possibly can!!

      Any other ideas?

      Thanks,

      Olly

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Is it because I don't have access on the server?? Could it be because my .mdb uses linked tables which link to another .mdb on our network?
        I would guess that one of these is a problem. I always have SQL Server installed dev/test/live, I dont use Access, so I assume you need the software too. Run some simple queries to test. This will also ensure your connection string is correct and eliminate linked tables in testing. HTH.

        Comment

        • ollyb303
          New Member
          • Dec 2007
          • 74

          #5
          It's the linked tables... I can display data from an "unlinked" table from the server without needing access installed on the server itself - I have tested this with a simple db with no linked tables. As soon as I add a link to a table on the netowrk and attempt to display data from it, I get the same error.

          Can anyone give me any tips as to how I can use linked tables in this way?

          Many thanks,

          Olly

          Comment

          Working...