title: Unable to access SQLite Database form windows services
body: <p>I have developed an ADD-in for outlook 2010. on outlook startup, ADD-in stored all the mail subjects in SQLite database.</p>
  <p>Now i have to create a windows services that will also access same database, and post it on rest-based services. But I am getting an error.</p>
  <p>Windows services is not able to access that database.</p>
  <pre><code> static void Main()
      {
          //try
          //{
              //=======Connection string=============
          string dbfile = @&quot;D:\testdatabase.db&quot;;
  
          sql_con = new SQLiteConnection
              (&quot;Data Source= &quot; + dbfile + &quot;;Version=3;New=False;Compress=True;&quot;);
              //=======Open Connection=============
              sql_con.Open();
              //=======Create dataset and store value in dataset===================
              sql_cmd = sql_con.CreateCommand();
              string CommandText = &quot;select * from mailbackup&quot;;
              DB = new SQLiteDataAdapter(CommandText, sql_con);
              //DS.Reset();
              DB.Fill(DS);
              //=======Store dataset value in text file============
              StringBuilder str = new StringBuilder();
              int rows = DS.Tables[0].Rows.Count;
              for (int i = 0; i &lt; rows;i++ )
              {
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[0].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[1].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[2].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[3].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[4].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[5].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[6].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[7].ToString());
                  str.AppendLine(DS.Tables[0].Rows[i].ItemArray[8].ToString());
                  StreamWriter sw = null;
                  sw = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + &quot;\\LogFile.txt&quot;, true);
                  sw.WriteLine(DateTime.Now.ToString() + &quot;: &quot; + str.ToString());
                  sw.Flush();
                  sw.Close();
              }
                  //=======Close Connection=============
                  sql_con.Close();
              //storedata();
          //}
          //catch(System.Exception ex)
          //{
  
          //}
      }
  </code></pre>
  <p>I am getting an error</p>
  <blockquote>
  <p>An unhandled exception of type 'Finisar.SQLite.SQLiteException' occurred in SQLite.NET.dll</p>
  <p>Additional information: unsupported file format</p>
  </blockquote>
  <p>it is working fine when we change the connection string</p>
  <pre><code> sql_con = new SQLiteConnection
          (&quot;Data Source= &quot; + dbfile + &quot;;Version=3;New=True;Compress=True;&quot;);
  </code></pre>
  <p>Create new database and open connection but after creating table using sqlite browser or SQLiteStudio, It start throwing the same error.</p>