title: "Unable to open the database file" (warning: Wide error)
body: <p>I cannot seem to get anything out of SQLite other than "Unable to open the database file" on IIS. I'm convinced SQLite's error messages are as brusque as Oracle's.</p>
  
  <ul>
  <li>Pre-deployment in Visual Studio 2010/IIS Express I can both read and write to the file.</li>
  <li>When I tried to read/write it with the same VS2010 project deployed to IIS7.5, all "create", "read" and "write" commands fail.</li>
  <li>The same occurs when I deploy the database file through the project and try to read it.</li>
  <li>I've given <code>Full control</code> access to App_Data and the database file to the following users: <code>IIS_IUSRS</code>, <code>IUSRS</code>, <code>DefaultAppPool</code>, and <code>Everyone</code>.</li>
  </ul>
  
  <p>I've looked at:
  <a href="https://stackoverflow.com/questions/7327460/sqlite-problem-unable-to-open-the-database-file">SQLite problem &quot;unable to open the database file&quot;</a> (The problem automatically went away for the user) and a number of other similar questions, most of which were solved by changing permissions, changing to a writable directory (App_Data should be writable, no?) or changing a relative path to an absolute one (which <code>|DataDirectory|</code> should resolve to).</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="sqlite" connectionString="Data Source=|DataDirectory|\datatables.sqlite;Version=3;" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Have I missed anything?</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Message&gt;An error has occurred.&lt;/Message&gt;
  &lt;ExceptionMessage&gt;Unable to open the database file&lt;/ExceptionMessage&gt;
  &lt;ExceptionType&gt;System.Data.SQLite.SQLiteException&lt;/ExceptionType&gt;
  &lt;StackTrace&gt;
  at System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) at System.Data.SQLite.SQLiteConnection.Open() at AjaxSource.Models.Database.query(String sql, Dictionary`2 parameters) in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Models\Database.cs:line 48 at AjaxSource.Models.aaDataModel..ctor() in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Models\aaDataModel.cs:line 18 at AjaxSource.Controllers.API.TableDataController.Get() in D:\Tools\Dropbox\Projects\myprojects\AjaxSource\AjaxSource\Controllers\API\TableDataController.cs:line 15 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;&gt;c__DisplayClass13.&lt;GetExecutor&gt;b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
  &lt;/StackTrace&gt;
  &lt;/Error&gt;
  </code></pre>