I've gotten a windows application to read an excel file with the following
code:
string ExcelConnStr = @"Driver={Microsoft Excel Driver
(*.xls)};DBQ=\\Server\Spreadsheets\Test.xls";
OdbcConnection ExcelConn = new OdbcConnection(ExcelConnStr);
ExcelConn.Open();
ExcelConn.Dispose();
However, when I use the same code in a CLR Stored procedure with an external
access assembly on a trusted database, I get the following error:
System.Data.Odbc.OdbcException: ERROR [HY001] [Microsoft][ODBC Excel Driver]
System resource exceeded.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr
failed
ERROR [HY001] [Microsoft][ODBC Excel Driver] System resource exceeded.
System.Data.Odbc.OdbcException:
at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle,
RetCode retcode)
at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection,
OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
at
System.Data.Odbc.OdbcConnectionFactory.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.Odbc.OdbcConnection.Open()
at StoredProcedures.usp_ImportExcel()
.
Any help is appreciated ...