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.
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:
I'm starting to tear my hair out here... please can someone help me??
Many thanks,
Olly
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 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>
Many thanks,
Olly
Comment