By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

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

ollyb303
P: 74
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.

Expand|Select|Wrap|Line Numbers
  1. Server Error in '/' Application.
  2. Disk or network error.
  3. Description: An unhandled exception occurred during the execution of the
  4. current web request. Please review the stack trace for more information
  5. about the error and where it originated in the code.
  6.  
  7. Exception Details: System.Data.OleDb.OleDbException: Disk or network error.
  8.  
  9. Source Error:
  10.  
  11.  An unhandled exception was generated during the execution of the current   
  12.  web request. Information regarding the origin and location of the          
  13.  exception can be identified using the exception stack trace below.         
  14.  
  15.  
  16.  
  17.  
  18.  
  19. Stack Trace:
  20.  
  21.  
  22.  [OleDbException (0x80004005): Disk or network error.]                      
  23.  
  24.  System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARA 
  25.  MS dbParams, Object& executeResult) +267                                   
  26.     System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&               
  27.  executeResult) +192                                                        
  28.     System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, 
  29.  Object& executeResult) +48                                                 
  30.     System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior    
  31.  behavior, String method) +106                                              
  32.     System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)  
  33.  +111                                                                       
  34.  
  35.  System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(Comman 
  36.  dBehavior behavior) +4                                                     
  37.     System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,          
  38.  DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String        
  39.  srcTable, IDbCommand command, CommandBehavior behavior) +141               
  40.     System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32            
  41.  startRecord, Int32 maxRecords, String srcTable, IDbCommand command,        
  42.  CommandBehavior behavior) +137                                             
  43.     System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) 
  44.  +83                                                                        
  45.  
  46.  System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelect 
  47.  Arguments arguments) +1770                                                 
  48.  
  49.  System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect(DataSourceSel 
  50.  ectArguments arguments) +74                                                
  51.     System.Web.UI.DataSourceView.Select(DataSourceSelectArguments           
  52.  arguments, DataSourceViewSelectCallback callback) +17                      
  53.     System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149         
  54.     System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70           
  55.     System.Web.UI.WebControls.GridView.DataBind() +4                        
  56.     System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82    
  57.  
  58.  System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()  
  59.  +69                                                                        
  60.     System.Web.UI.Control.EnsureChildControls() +87                         
  61.     System.Web.UI.Control.PreRenderRecursiveInternal() +50                  
  62.     System.Web.UI.Control.PreRenderRecursiveInternal() +170                 
  63.     System.Web.UI.Control.PreRenderRecursiveInternal() +170                 
  64.     System.Web.UI.Control.PreRenderRecursiveInternal() +170                 
  65.     System.Web.UI.Control.PreRenderRecursiveInternal() +170                 
  66.     System.Web.UI.Page.ProcessRequestMain(Boolean                           
  67.  includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041 
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
  75. 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:

Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderColor="Yellow"
  2.             BorderStyle="Solid" BorderWidth="2px" DataSourceID="AccessDataSource1" Font-Names="Verdana"
  3.             Font-Size="Small" ForeColor="Black">
  4.             <Columns>
  5.                 <asp:BoundField DataField="Manager" HeaderText="Manager" SortExpression="Manager" />
  6.                 <asp:BoundField DataField="Advisor_Name" HeaderText="Advisor Name" SortExpression="Advisor_Name" />
  7.             </Columns>
  8.         </asp:GridView>
  9.  
  10.         <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/TeamLists.mdb"
  11.             SelectCommand="SELECT [Manager], [Advisor Name] AS Advisor_Name FROM [TeamAndrew]">
  12.         </asp:AccessDataSource>
I'm starting to tear my hair out here... please can someone help me??

Many thanks,

Olly
Apr 26 '08 #1
Share this Question
Share on Google+
4 Replies


Shashi Sadasivan
Expert 100+
P: 1,435
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
Apr 27 '08 #2

ollyb303
P: 74
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
Apr 28 '08 #3

kenobewan
Expert 2.5K+
P: 4,871
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.
Apr 28 '08 #4

ollyb303
P: 74
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
Apr 29 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.