Hi all,
 
When trying to log into an access db using the AdoNetAdapter with an OleDb
connection i get the following error in a  VS 2005 (.NET 2.0) project.
Please take note that the exact same project with the same configuration
works fine under .NET 1.1 (VS 2003).

A first chance exception of type
'System.Runtime.InteropServices.InvalidComObjectException' occurred in
System.Data.dll
log4net:ERROR [AdoNetAppender] Exception while writing to database
System.Runtime.InteropServices.InvalidComObjectException: COM object that
has been separated from its underlying RCW cannot be used.
   at System.Data.Common.UnsafeNativeMethods.ICommandText.Execute(IntPtr
pUnkOuter, Guid& riid, tagDBPARAMS pDBParams, IntPtr& pcRowsAffected,
Object& ppRowset)
   at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
   at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
   at log4net.Appender.AdoNetAppender.SendBuffer(IDbTransaction dbTran,
LoggingEvent[] events)
   at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events)
A first chance exception of type
'System.Runtime.InteropServices.InvalidComObjectException' occurred in
System.Data.dll
log4net:WARN AdoNetAppender: Exception while disposing cached command object
System.Runtime.InteropServices.InvalidComObjectException: COM object that
has been separated from its underlying RCW cannot be used.
   at
System.Data.Common.UnsafeNativeMethods.IAccessor.ReleaseAccessor(IntPtr
hAccessor, Int32& pcRefCount)
   at System.Data.OleDb.RowBinding.Dispose()
   at System.Data.OleDb.Bindings.Dispose()
   at System.Data.OleDb.OleDbCommand.CloseInternal()
   at System.Data.OleDb.OleDbCommand.ResetConnection()
   at System.Data.OleDb.OleDbCommand.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at log4net.Appender.AdoNetAppender.OnClose()


The configuration file of log4net for AdoNetAdapter looks like this:
<appender name="MSAccess" type="log4net.Appender.AdoNetAppender">
                <connectionType value="System.Data.OleDb.OleDbConnection,
System.Data, Version=1.0.330.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>              
                <connectionString
value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\nviorres\Develepoment\e-passport\CSCA-05\csca.mdb;User
Id=Admin;Password=;" />

Thanks in advance
Nikos


Reply via email to