"Access is denied" while attaching DB

Topics: Setup / Configuration
Aug 1, 2007 at 7:59 PM
Edited Aug 1, 2007 at 8:09 PM
So I'm trying to go script-by-script in the Install directory and repair the scripts and update the source code (for building on Vista 64-bit and Orcas Beta 2) as I go, posting issues along the way.

I'm only on Script "2 - Restore Database.bat" and I get this:

C:\dinnernow-orcas\scripts\Install>"2 - Restore Database.bat"
Restoring the DinnerNow database...
processed file: ..\..\database\dinnernow.bak
Successfully processed 1 files; Failed processing 0 files
C:\dinnernow-orcas\database
C:\dinnernow-orcas\scripts\Install
Msg 5133, Level 16, State 1, Server VISTA64VM\SQLEXPRESS, Line 1
Directory lookup for the file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DinnerNownew.mdf" failed with
the operating system error 5(Access is denied.).
Msg 3156, Level 16, State 3, Server VISTA64VM\SQLEXPRESS, Line 1
File 'DinnerNownew' cannot be restored to 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DinnerNownew.mdf'.
Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Server VISTA64VM\SQLEXPRESS, Line 1
Directory lookup for the file "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\DinnerNownew_log.ldf" failed
with the operating system error 5(Access is denied.).
Msg 3156, Level 16, State 3, Server VISTA64VM\SQLEXPRESS, Line 1
File 'DinnerNownew_log' cannot be restored to 'c:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\DinnerNownew_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Server VISTA64VM\SQLEXPRESS, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Server VISTA64VM\SQLEXPRESS, Line 1
RESTORE DATABASE is terminating abnormally.
C:\dinnernow-orcas\scripts\Install>

I'm using 64-bit Vista Ultimate (which is why I'm fixing things as I go). I have SQL Server 2005 Developer Edition installed in addition to SQLExpress. I changed security on SQLExpress to mixed mode but don't know what else to change. SQLExpress is installed at c:\Program Files (x86)\Microsoft SQL Server\MSSQL.4\MSSQL .. I don't understand why it's trying to restore to MSSQ.1 since the path is being looked up.

If anyone has ideas please share; I'll post again if I resolve this.
Aug 8, 2007 at 7:15 AM
Resolution posted here (4th comment)

http://www.codeplex.com/DinnerNow/Thread/View.aspx?ThreadId=13394