title: Database says read-only
body: <p>I have installed SQL Server 2005 with the SQL Server Management Studio Express and tried attaching the database. The attach was successful, but the issue was next to database name it was saying read-only.</p>
  
  <p>After that I tried these commands</p>
  
  <pre><code>USE [master]
  GO
  ALTER DATABASE [TESTDB] SET READ_WRITE WITH NO_WAIT
  GO
  </code></pre>
  
  <p>But I got this error ,</p>
  
  <blockquote>
    <p>Msg 5120, Level 16, State 101, Line 1<br>
    Unable to open the physical file “D:\Soft\Data\Data_Data.MDF”. Operating system error 5: “5(Access is denied.)”.<br>
    Msg 5120, Level 16, State 101, Line 1<br>
    Unable to open the physical file “D:\soft\Data\Data_Log.LDF”. Operating system error 5: “5(Access is denied.)”.<br>
    File activation failure. The physical file name “D:\Soft\Data\Data_Log.LDF” may be incorrect.<br>
    Msg 945, Level 14, State 2, Line 1<br>
    Database ‘Lis’ cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.<br>
    Msg 5069, Level 16, State 1, Line 1<br>
    ALTER DATABASE statement failed.</p>
  </blockquote>
  
  <p>Can you tell me what to do in order to make my database read and write?</p>