Wednesday, March 21, 2012

Atlas Samples Database Cannot Connect

I have SQL 2005 Express and SQL 2005 Developer Edition

I installed the Atlas examples in the default location but the example websites fail.

System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance.

If I try to attach to the .MDF files using Management Studio in the website app_data folder I get this:

Attach database failed for Server 'local\SQLEXPRESS'. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft ASP.NET\Atlas Sample Applications\TaskList\App_Data\Tasklist_log.LDF'.
Could not open new database 'C:\WEBSITES\WEBNET\MISC\ATLAS\SRC\APPS\TASKLIST\APP_DATA\TASKLIST.MDF'. CREATE DATABASE is aborted.
File activation failure. The physical file name "C:\websites\webnet\misc\atlas\src\Apps\TaskList\App_Data\Tasklist_log.ldf" may be incorrect. (Microsoft SQL Server, Error: 5123)

I don't have a c:\websites folder and there is no .ldf file shipped with these examples.

Do they test this stuff before offering them up for people to waste an entire Sunday pissing around with examples that don't work? What's going on?

hello.

it looks like you don't have enough permissions on the folder where the sql database is placed to do what you're after. maybe you should take this issue to the sql express forum (i think that you'llget a faster answer there.)


Thanks Luis,

It turns out that I had SQL Express installed from my VS 2005 installation. The version of SQL 2005 Developer I had would not install because it said the Express version was newer. So, I had to uninstall Express, install Developer Edition then re-installed Express to use the examples.

Long and short of it is, if you do that you need to delete the Documents and Settings\<user>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS folder so it will re-create that folder with the current install of SQLExpress. That is where it creates files related to a user instance of SQL Server that dynamically attaches .mdf files like the Atlas examples.

How stupid of me to not know that... Hmmm

No comments:

Post a Comment