System.Data.OleDb.OleDbConnectionInternal..ctor: Undefined error

After a few hours (~ 6 hours Win7 64bit, ~ 24hours WinXP), a multithreaded (.NET Framework 3.5 SP1 WinForms) desktop application that uses .mdb files as a backend is working. I get the following runtime error:

Exception → Undefined error

StackTrace →

in System.Data.OleDb.OleDbConnectionInternal..ctor (OleDbConnectionString constr, connection OleDbConnection)
in System.Data.OleDb.OleDbConnectionFactory.CreateConnection (DbConnectionOptions parameters, Object poolGroupProviderInfo, DbConnectionPool Pool, DbConnection owningObject)

in System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection (DbConnection owningConnection, DbConnectionPoolGroup poolGroup)

in System.Data.ProviderBase.DbConnectionFactory.GetConnection (DbConnection owningConnection)

in System.Data.ProviderBase.DbConnectionClosed.OpenConnection (DbConnection externalConnection, DbConnectionFactory ConnectionFactory)

in System.Data.OleDb.OleDbConnection.Open ()

in NetworkManager.SearchInputFileHandler.GetInputRows (SearchProgramTypeEnumeration programType, Int32 startRowNum, Int32 rowsQty, Boolean setupInProgress, Boolean filterOutUninitializedRows)

This seems to be an OleDbProvider error.

Have you seen / experienced something like this?

Context:

(1) I use exclusively

using (OleDbConnection cnn = new OleDbConnection ("{{mymdbConnectionStringHere}}")) {

cnn.Open ();

...

}

(2) I use the IN clause in some SQL statements to point to external MDB tables.

I think the problems are caused by the case (2). Although this is still a hypothesis here to check (some code corrections are needed in the base code of my application, and now I think it's worth it to fix the errors, or better switch to the MS SQL backend.)

Thanks.

+6
c # oledb oledbconnection
source share
3 answers

Was there any progress in finding a solution to this problem or a more workaround?

I have a similar problem in an ASP.NET application reading an Excel file. This is only visible in a production environment where many users try to process various XLS files on the server side. After reusing IIS at night, about ~ 200 requests (to open excel) that will hang the JET engine. The problem is that all subsequent attempts fail, so the retry logic will not help much. Only IIS reset heals the problem.

From my investigation, there are several options:

  • Switch to another library to read XLS files: Excel OLE Automation — Requires Excel to be installed on the server and have many requests, which would create many examples of the Excel process that are unacceptable. Third-party library - is it all free?
  • Move Excel processing to separate the process. Exchange data with another format in XML format.
  • Use some intelligent processing to control the number of open and closed OLEDB processes.

Any thoughts?

+3
source share

I had the same problem. Reusing only the application pool in IIS worked for me.

+2
source share

I wrote an example test application - the problem is caused by an error somewhere in the inside of the .NET System.Data.OleDb.

VS2008 SP1 solution published here: sample demonstration of System.Data.OleDb errors

+1
source share

All Articles