title: Custom Windows Service conflicting with Microsoft.ACE.OLEDB.12.0
body: <p>I have an SSIS package that uses the Microsoft.ACE.OLEDB.12.0 provider to read information from tab delimited text files. There is a script task in the package that has some code like so:</p>
  
  <pre><code>DataTable dtFiles = new DataTable();
  string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileInfoLocation + ";Extended Properties=\"text;HDR=NO;FMT=TabDelimited\"";
  
  OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM RepairFiscalYears.txt", connStr);
  adapter.Fill(dtFiles);
  </code></pre>
  
  <p>This package runs as a local user, lets say UserA. Recently, a co-worker created a Windows Service on the same box the SSIS package runs on. The service's "Log on As" is set to the same UserA as the SSIS package runs. Now when I try to run the SSIS package I get the following error on the adapter.Fill(dtFiles) line.</p>
  
  <pre><code>EXCEPTION THROWN: 12/31/2014 3:04:06 AM
  Unspecified error
  Source: Microsoft Access Database Engine
  HelpLink: 
  StackTracee:    at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
     at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
     at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
     at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection)
     at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
     at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
     at System.Data.OleDb.OleDbConnection.Open()
     at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
     at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
     at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
     at ST_ee4c7bf65c87474397e28ea0f96c53d9.ScriptMain.Main()
  </code></pre>
  
  <p>If I stop the service and run the package it works fine. If I re-start the service and run the package it fails so I can easily reproduce the issue. Why does a Windows Service running under the same user as the SSIS package cause this conflict with the OLEDB provider? </p>
  
  <p>Keep in mind that the Windows Service does nothing related to the package, i.e. doesn't read/write from any of the same locations/files/etc. </p>
  
  <p>Any help is much appreciated.</p>