title: Cannot attach database SQL Server 2012 error 5
body: <p>When I type this:</p>
  
  <pre><code>CREATE DATABASE AdventureWorks2012
  ON (FILENAME = 'C:\Users\sohm\Desktop\Pohm\AdventureWorks2012_Data.mdf')
  FOR ATTACH_REBUILD_LOG ;
  </code></pre>
  
  <p>I get this:</p>
  
  <blockquote>
    <p><em>File activation failure. The physical file name
    "C:\Users\sohm\Desktop\AdventureWorks2012_Data_log.ldf" may be incorrect.</em><br>
    <em>Msg 5123, Level 16, State 1, Line 1<br>
    CREATE FILE encountered operating system error 5 (Access is denied.) while attempting to
    open or create the physical file 'C:\adventuredb\AdventureWorks2012_Data_log.ldf'.<br>
    Msg 1813, Level 16, State 2, Line 1<br>
    Could not open new database 'AdventureWorks2012'. CREATE DATABASE is aborted.</em>  </p>
  </blockquote>
  
  <p>I know it has to do with permissions.  I have the administrator account.  I have read a million posts but nothing has worked so far.  Also when I try to change the folder containing the mdf file, to full control but it keeps reverting back to read-only. </p>