all groups > sql server new users > october 2007 >
You're in the

sql server new users

group:

Attach error: cannot be upgraded because it is read-only or has read-only files



Attach error: cannot be upgraded because it is read-only or has read-only files AlexW
10/15/2007 9:08:53 PM
sql server new users: I'm installing SQLExpress SP2 as part of an application installation.
One requirement for this installation is to make the installing and
configuration of SQLExpress, the target database and the application
that uses it as easy button as possible. The installation of
SQLExpress, my database and application all go well, except that when
I go to attach the database that I have just placed on the target PC.
I get the following error:

File activation failure. The physical file name "C:\Program Files
\myApp \Database\myDatabase_log.ldf" may be incorrectError getting
Information From SysLogins

If I open up SQLExpress Management Studio and go to attach the same
database files I get the error:

Database 'myDatabase' cannot be upgraded because it is read-only or
has read-only files. Make the database or files writeable, and rerun
recovery. (Microsoft SQL Server, Error: 3415)

OS: XP SP2 with .Net 2.0
Database file is placed in a sub-directory of the application.
I've used database files created with Both SQLServer 2005 and
SQLExpress. I've even created the database on the target machine,
detached it, moved the files into my installation program and
installed them and still get the same error messages.

If manually go in and grant the service that SQLExpress is running
under (in this case Local System) full read/write access to the
directory in which I later install and attach the database files, then
attach runs perfectly.

On SQL Server 2005 this problem does not occur. I can put the
database anywhere without a problem. Is this a SQLExpress bug? How
can I fix this programmatically?
Re: Attach error: cannot be upgraded because it is read-only or has read-only files Ekrem_Önsoy
10/16/2007 12:00:00 AM
Hello Alex,


Ensure that your mdf (if any) ndf and ldf files are not read-only. Go to
their file properties and observe.


--
Ekrem Önsoy
MCBDA, MCTS: SQL Server 2005, MCITP:DBA, MCSD.Net, MCSE, MCT



[quoted text, click to view]
AddThis Social Bookmark Button