More adventures with SQL Server Express

This was fun. It’s a completely different database and set of circumstances than last night’s fun and frivolity.

I finished an application, zipped up the folders and sent it off to a client. In this application there is a desktop app that talks to a web service that talks to a SQL Server 2005 Express database. Sounds fairly simple, right? Right.

Well, the client unzips it all to a directory, sets up the virtual application for the web service and starts trying to run the desktop portion. It starts up, pulls up all of the lookups that we have in the database and it all looks good. Now, I’m on the phone and elated at how smooth this is going. At this point, the client tries to create a new record which is going well (wow, even a little drop down calendar and oooh look at that, it’s all of the types of records that I could create so I don’t have to type there… wow… and more gushing) until they try to save… At this point, there is a wonderful error that pops up –

“Failed to update database ‘database name.mdf’ because the database is read-only.”

Crud! After getting them to check the file properties and other such things, I called Patrick Steele, who has been working with me on this project, to see what he thought about it. It’s been a long day, especially after last night’s SQL Server Express issues, so I’m not thinking all that clearly. Patrick, after running through some of the same questions that I had so I’m feeling a little better about my thinking, has the thought that it might be a security issue and that the ASPNET user might not have permissions to write to that directory. Sure enough, since the ASPNET user doesn’t have permissions the database loads in read-only mode. Fix that and the database and the app work just fine.

Leave a Reply

Your email address will not be published. Required fields are marked *