title: Attach database failed for server
body: <p>I am trying to attach a database in SQL Server 2008 and I have .mdf file of database but I am getting an exception of</p>
  <blockquote>
  <p>Attach database failed for Server 'Bilal-PC'.  (Microsoft.SqlServer.Smo)</p>
  <p>Unable to open the physical file &quot;E:\Intelliscence\Backups\test (2011-07-19)\Database\QBankDB.mdf&quot;. Operating system error 5: &quot;5(Access is denied.)&quot;. (Microsoft SQL Server, Error: 5120)</p>
  </blockquote>
  <p>I searched the solution of this problem and found one solution of access rights of database file but database file has already full control access rights. Now I want to attach this database or want to get script of this database. But How?</p>
  <p>I know this is a duplicate question but all the solutions given in answers are not working for me that's why I am posting this question.</p>
  <p>Please help me.</p>