System.Data.OleDb.OleDbException: Unspecified error

815492_30356691If you are getting an error like the one below in your ASP.Net application when trying to open an Excel or Access file, you may need to reset IIS.

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

To reset IIS:

  • Open a command prompt on the box running IIS.
  • Issue the command: iisreset

My situation was that I had code that had previously worked, but it just stopped working one day with the error mentioned above.

Hope this helps.

  • Share/Bookmark

About the Author

David is an IT professional with over 26 years of experience (he started his career as a teenager). He has programmed in more languages and on more types of computers (and similar devices) than he can remember, including TRS-80 Model I Level 2, Commodore Vic-20 and C-64, C-128, Industrial Process Controllers, CP/M machines, and Intel 80x86+ architectures. He currently uses Microsoft .NET Framework tools and SQL Server. When he's not geeking out, he studies the Martial Art, Aikido; engages in community volunteer work; writes fiction (as well as non-fiction blogs); and does home rennovation work. He lives in Charlotte NC, USA.