The reference wasn't a lot of specific help but I will check the permissions thingy. But I do agree with his peroration. I really do not care for MS, but I'm constrained to work on their platforms. Generally MS stuff seems pretty poor to me ( e.g. Win 8 ).
Well, enough of complaining. What I do find interesting after looking carefully at the error message is the reference to the DB being in the 2009R2 "domain". I'm trying to restore a 2008R2 DB Backup ( XXX.bak ) file to a 2012 DB. But SSMS seems to be pointing to the 2008R2 DB mdf??? Don't really understand this.
Bill
>>System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS2008R2\MSSQL\DATA\Lepton.mdf'. (Microsoft.SqlServer.SmoExtended)
>
>Perhaps
What was that error again? will help. Check the account that your SQL is running as, and make sure that that account has the rights... it may be that 2008 has set some attributes or protection there, so any nasty intruders like SQL 2012 wouldn't be able to touch it.
>
>The simpler way, without much fuss about rights, would be to create your restored database in some folder different from this, which wouldn't be touched by hostile software written by competing companies (for instance, Microsoft).
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.