Last post Jul 01, 2009 11:52 AM by hans_v
Jun 30, 2009 03:10 PM|dcjohnston|LINK
OK, this should be simple,
I have written a very simple web page with a gridview that uses an access database. This page works fine on the workstation that I am working on, but if I publish it to the ASP.NET 2.0 supported IIS webserver the gridview will not load the data.
No errors, it just times out after 90 seconds or so.
I have the Access database in the App_data folder and all rights are good on the server.
Is it possible the Access database is invisible to the form on the client workstation? I have given ASPNET access to the folder and I even published to the root of the website ( c:\inetpub\wwwroot)
Jun 30, 2009 10:19 PM|ramireddyindia|LINK
It May be the query is taking more time, increase the command timeout property of the oledb command,
and also it may be connection string issue also, check the below link for connection strings.
Jul 01, 2009 09:10 AM|hans_v|LINK
I have given ASPNET access to the folder
What kind of access? You need so set MODIFY permissions
Also, could you post your HTML markup and code?
Jul 01, 2009 09:11 AM|hans_v|LINK
It May be the query is taking more time
90 seconds for a simple query?
Jul 01, 2009 09:22 AM|dcjohnston|LINK
However, I am not sure where to find the connection string. Well let me restate, I am using the query builder in VS2005 and under the connectionstrings tag in the web.config there is nothing under it (see below.) The app works fine locally. The timeout
without error may be a problem but of course locally it does not take that long.
Correct me if I am wrong but the app runs on the server as ASPNET and thus ASPNET should have access to see the database correct? Given that, the only issue could be when I run this app locally it runs under my credentials and I have access to the database.
This is really confusing me
Jul 01, 2009 09:26 AM|hans_v|LINK
Correct me if I am wrong but the app runs on the server as ASPNET and thus ASPNET should have access to see the database correct?
That depands. I don't think you read the link I provided:
"for XP Pro machines, the user is the ASPNET account. On Windows Server 2003, 2008 and Vista, it is the NETWORK SERVICE account. However, if you have ASP.NET Impersonation enabled, the user account will be IUSR_machinename."
Jul 01, 2009 11:24 AM|dcjohnston|LINK
You are correct Hans, I did not see your post, thanks for the reply,
I checked my permissions and added the IUSR account and also the ASPNET account. Still not working.
To test this problem I created a basic web project with a simple database with 10 lines of data. ( to test timing out)
I created a website project and dragged a gridview to the form. Added the access database to the APP_Data folder.and selected two fields from the table (tblApps) in the database.
Ran it locally and the grid loaded with the data. See code of the page below.
If I run this from ANY webserver no good. Very odd.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1">
<asp:BoundField DataField="CompName" HeaderText="CompName" SortExpression="CompName" />
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/InstalledApps.mdb"
SelectCommand="SELECT DISTINCT [CompName] FROM [tblApps]"></asp:AccessDataSource>
Jul 01, 2009 11:52 AM|hans_v|LINK
It looks good, and since it is working on your local machne, the only thing I can think of is still a permisions issue....