J
JT
I have created a simple ASP.NET application on the intranet, accessible only
to 2 users who will log in as Administrator; the server runs Windows 2000
Advanced Server. Page language is C#. The application accesses a database
that runs on SQL Server 2005 Express Edition, on the same machine where the
application is hosted. The database is used widely in our office from
Windows Forms applications, and in the ASP.NET application, I used the same
connection string I use for Windows Forms applications. Everything works
fine when debugging the new ASP.NET application in Visual Studio because VS
automatically logs in as Administrator. However, when I run the application
from a browser - locally or across the intranet, it denies access to the
database with the following message:
[SqlException (0x80131904): Cannot open database "Records" requested by the
login. The login failed. Login failed for user 'MACHINENAME\ASPNET'.]
So I disabled Anonymous Access in ISM, and enabled Integrated Windows
Authentication so that I would be automatically logged in as Administrator.
I also revised the Web.Config file for this application to deny access to
all but Administrators. In the Form.Load section of the page, I put the
following code to display the username so I can be sure:
string userstring = User.Identity.Name.ToString();
Response.Write(userstring);
When the page loads, it shows the Administrator name at the top, so that's
working correctly. However, I still get the same error message - it denies
access to the database for user MACHINENAME\ASPNET, even though I'm logged
into the application as Administrator.
Any ideas would be most appreciated. Thanks.
to 2 users who will log in as Administrator; the server runs Windows 2000
Advanced Server. Page language is C#. The application accesses a database
that runs on SQL Server 2005 Express Edition, on the same machine where the
application is hosted. The database is used widely in our office from
Windows Forms applications, and in the ASP.NET application, I used the same
connection string I use for Windows Forms applications. Everything works
fine when debugging the new ASP.NET application in Visual Studio because VS
automatically logs in as Administrator. However, when I run the application
from a browser - locally or across the intranet, it denies access to the
database with the following message:
[SqlException (0x80131904): Cannot open database "Records" requested by the
login. The login failed. Login failed for user 'MACHINENAME\ASPNET'.]
So I disabled Anonymous Access in ISM, and enabled Integrated Windows
Authentication so that I would be automatically logged in as Administrator.
I also revised the Web.Config file for this application to deny access to
all but Administrators. In the Form.Load section of the page, I put the
following code to display the username so I can be sure:
string userstring = User.Identity.Name.ToString();
Response.Write(userstring);
When the page loads, it shows the Administrator name at the top, so that's
working correctly. However, I still get the same error message - it denies
access to the database for user MACHINENAME\ASPNET, even though I'm logged
into the application as Administrator.
Any ideas would be most appreciated. Thanks.