Solved

SQL Express deployed database is read only

Posted on 2007-12-02
3
958 Views
Last Modified: 2013-11-27
I developed an ASP.NET website using VS Web Developer Express with an SQL Express database as an attached file.  I copied my website file and app_data folder (with contents) to the server that is going to run the website.  The server is also running SQL Express.  When I attempt to run the program and update the database I get the "Failed to update database "C:\INETPUB\WWWROOT\DOMAINREQUEST\APP_DATA\DOMAINS.MDF" because the database is read-only" error.  If I connect to the database using the SQL Manager the database option for read-only is set to false.  If I attempt to modify the [guest] and [user] permissions and then view the website I get an error that "NT AUTHORITY\NETWORK SERVICE" is unable to connect.

I've been searching the newsgroups/web for 2 days now trying to find a solution.  Please help!
0
Comment
Question by:tmayne77
  • 2
3 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20392865
The error relates to the fact that the physical file - C:\INETPUB\WWWROOT\DOMAINREQUEST\APP_DATA\DOMAINS.MDF
is read only by the account "NT AUTHORITY\NETWORK SERVICE", which is set up to run SQL Server.
WWWROOT subfolders usually are very restrictive. Consider moving the .MDF file elsewhere.
You may have to reset permissions after the move.
0
 

Author Comment

by:tmayne77
ID: 20393332
Does this mean I should move the file elsewhere beneath the WWWROOT folder or above that somewhere in the directory structure?
0
 
LVL 25

Accepted Solution

by:
imitchie earned 500 total points
ID: 20393350
somewhere else completely ouside of WWWROOT. Alternatively, you can leave it there, but just configure the permissions correctly. The SQL service account must be able to read/write the .MDF and .LDF files.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question