Note that there are some explanatory texts on larger screens.

plurals
  1. POOleDB connection to excel file fails ONLY in production
    text
    copied!<p>I have a VB application using .NET 3.5 that allows users to upload an Excel file. The application then reads from this file and inserts its contents into a database.</p> <p>The problem is that the read seems to fail in our PRODUCTION environment only. Here's the error produced:</p> <pre><code>ErrorMessage: System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at uploader.ReadExcel(String sFile) in E:\path_to_application\uploader.aspx.vb:line 85 </code></pre> <p>Here's lines 84 and 85 of the ReadExcel function in uploader.aspx.vb:</p> <pre><code>oConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFile + ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";") oConn.Open() </code></pre> <p>oConn.Open() fails ONLY in production, the exact same codebase on my local machine works as expected. </p> <ul> <li>The file does indeed exist at the path specified in the <code>sFile</code> variable</li> <li><a href="https://stackoverflow.com/questions/96150/oledbconnection-open-generates-unspecified-error">This question</a> suggested it might be a problem with exceeding the concurrent connection limit, but even after restarting the application with IIS the problem persisted</li> <li>It does not seem to be a permissions issue, all user groups on the server have at least Read &amp; Execute on the uploaded files</li> </ul> <p>What other differences could I look for between the production and local environments? What else could cause opening this OleDB connection to fail like this?</p> <p><strong>UPDATE</strong>: A workaround seems to be to recycle the application pool in IIS. Any ideas on what it is that's being reset that fixes it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload