I have a machine with Windows XP Pro w/SP 2, IIS, SQL Server Express and Visual Studio 2005 installed. When I attempt to open a database from an ASPX page, I'm getting an exception with the message:
"Cannot open database "Tasks" requested by the login. The login failed.
Login failed for user 'MYDEV\ASPNET'."
I've searched the web and found a number of pages that talk about the "Login failed for MACHINE\ASPNET" issue, but I didn't find any with a solution.
For your information (in case it makes any difference), the computer is connected to a domain. And the authentication methods for the virtual directory (in IIS) is configured for "Anonymous access" and "Integrated Windows authentication."
Does anyone know how to configure SQL Server Express (or is it IIS?) so the web page can access the database?
RichardR
Okay, I found a solution.
For anyone else experiencing this problem, here's what I did:
First, I installed the November CTP of SQL Server Management Studio Express.
Then, I added the account MACHINENAME\ASPNET under Security | Logins. I did a right-mouse click on the ASPNET login name and clicked on Properties.
This brought up the Login Properties page for ASPNET. I mapped the ASPNET account to my database selecting the database in the "Default Database" dropdown.
In order for the stored procedures to execute, I also needed to check the db_owner box under the Mappings tab.
Finally, I needed to change the connection string to:
Data Source=MYDEV\SQLEXPRESS;Connect Timeout=30;User Instance=False;initial catalog=Tasks;Integrated Security=SSPI;Persist Security Info=False
Hope this helps anyone else encountering this problem.
Richard
|||Thanks - that was very helpful!!!|||Thanks for the post! Saved my life after hours of searching!!!
No comments:
Post a Comment