0

I have WinXP Pro 32-bit.

I want to run a free trial for a web-based application. The app uses IIS 5.1 and MS SQL Server 2008 R2 (which is SQLEXPRESS). All of these are entirely on my own, single-user laptop.

When I type the following, I get an error::

localhost/gemini

The error is:

Cannot open database "Gemini" requested by the login. The login failed. Login failed for user '<laptop_name>\ASPNET'.

I use Windows Authentication. The connection string in the app web.config is:

<add name="Gemini" connectionString="data source=(local)\SQLExpress;initial catalog=Gemini;trusted_connection=true;" providerName="System.Data.SqlClient"/>

I have SQL Server Management Studio.

I've been advised to grant the 'laptop_name\ASPNET' user all access to the Gemini database.

I'm not a techie. I would be grateful if someone could advise me how to grant access to that user. Because my laptop is single-user, I just want a simple solution - not a complex thief-proof, hack-proof solution :)

OldGrantonian
  • 597
  • 1
  • 8
  • 23

1 Answers1

0

Before I answer the question, let me remind you that there are security implications in granting IIS/ASP.NET login full access to your SQL Server Express. In particular, if someone breaks into your IIS/ASP.NET they could use SQL Server Express to execute any code via SQLCLR assembly.

Now, to the qiestion itself. I am assuming you have installed SQL Server Express and therefore are an administrator on the instance. All you need to do is to execute this T-SQL code using SQL Server Management Studio:

create login [<laptop_name>\ASPNET] from windows;
exec sp_addsrvrolemember N'<laptop_name>\ASPNET', sysadmin
Krzysztof Kozielczyk
  • 5,887
  • 37
  • 28
  • Many thanks for your kind reply. My laptop is single-user, the db is on my own computer, and the free trial will be deleted after use, so I can accept the security risks. I was hoping for "point-and-click" instructions using SQL Server Management Studio. But it occurred to me that if I simply copied-and-pasted your code, there might be new entries in the SSMS under "Users", "Database Roles", and/or "Application Roles". (more.....) – OldGrantonian Sep 28 '12 at 11:07
  • (...continued) So, I could study these entries to learn the "point-and-click" method. However, after executing the code, and getting a success message, there are no new entries in SSMS after Refresh. Typing localhost/gemini produces the same error as previously. I would be most grateful if you could tell me the steps to use for "point-and-click". – OldGrantonian Sep 28 '12 at 11:08
  • Sure, the same can be done from the SSMS UI... I just thought there's nothing simpler than Copy-Paste of a piece of code :-) – Krzysztof Kozielczyk Sep 28 '12 at 23:58