title: Attempt to write a read-only database - System.Data.SQLite
body: <p>I'm having a little bit of a problem that I thought was related to Security but, turns out can't be as I did almost everything ...</p>
  
  <p>Plenty of information on this on the web but nothing has an answer to fix the issue.</p>
  
  <p>Let me tell my steps:</p>
  
  <ul>
  <li>Have a Website on VS2k8 that when I debug or start from Cassini, all works fine</li>
  <li>When setting up IIS 7.5 (Win7) to point to this website and after adding IIS_IUSRS Modify rights I get the error</li>
  <li>Same thing using IIS 6.0!</li>
  </ul>
  
  <p><strong>Img: Security on Database File from IIS 7.5</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Too2c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Too2c.png" alt="alt text"></a><br>
  <sub>(source: <a href="http://www.balexandre.com/temp/2010-02-25_1028.png" rel="nofollow noreferrer">balexandre.com</a>)</sub>  </p>
  
  <p><i>Note that all other files and folders have the same rights as above</i></p>
  
  <p>The full Error is:</p>
  
  <pre><code>Log: Executing query on SQLite Database
  
  Message ***************************************
  Attempt to write a read-only database
  attempt to write a readonly database
  
  Stack Trace ***********************************
  at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
  at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
  at System.Data.SQLite.SQLiteDataReader.NextResult()
  at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
  at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
  at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
  at soDatabaseManager.CommitPersonsToKitchenDatabase() in c:\Adwiza\Kitchen\App_Code\soDatabaseManager.cs:line 242
  </code></pre>
  
  <hr>
  
  <p><strong>P.S.</strong> <strong>Keep in mind</strong> that this has to work with IIS 6 (windows 2003) as well, the IIS 7.5 is only for troubleshooting as we have more control in everything...</p>