473,320 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

"COM object that has been separated from its underlying RCW cannot be used."

(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be used."
The code this is causing the exception is:
<code>
try
{
m_command.CommandText = GetAccessSprocString(m_spDeleteProtocol);
m_command.Parameters.Clear();
OleDbParameter param = new OleDbParameter("_protocolID",
protocol.ProtocolID);
m_command.Parameters.Add(param);

// open the connection and execute the update
m_connection.Open();
m_command.ExecuteNonQuery(); // THIS IS THE LINE THAT CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError(e.Message, new StackFrame(true));
}
catch (Exception ee)
{
m_log.LogError(ee.Message, new StackFrame(true));
}
finally
{
m_connection.Close();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much light.
Anyone know common causes for this exception?
Thanks for any help,
Steve
Dec 20 '05 #1
2 8106
Steve,

I would try and create the connection object once in the method itself,
and not store it on the class level as a field.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steve" <ss*@sss.com> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be
used."
The code this is causing the exception is:
<code>
try
{
m_command.CommandText = GetAccessSprocString(m_spDeleteProtocol);
m_command.Parameters.Clear();
OleDbParameter param = new OleDbParameter("_protocolID",
protocol.ProtocolID);
m_command.Parameters.Add(param);

// open the connection and execute the update
m_connection.Open();
m_command.ExecuteNonQuery(); // THIS IS THE LINE THAT
CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError(e.Message, new StackFrame(true));
}
catch (Exception ee)
{
m_log.LogError(ee.Message, new StackFrame(true));
}
finally
{
m_connection.Close();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much
light.
Anyone know common causes for this exception?
Thanks for any help,
Steve

Dec 20 '05 #2
Hi Nicholas,

OK, I tried that and I still get the exception. Very weird. I can't really
find much on google either. Any other ideas?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OE**************@TK2MSFTNGP10.phx.gbl...
Steve,

I would try and create the connection object once in the method itself,
and not store it on the class level as a field.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steve" <ss*@sss.com> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be
used."
The code this is causing the exception is:
<code>
try
{
m_command.CommandText = GetAccessSprocString(m_spDeleteProtocol);
m_command.Parameters.Clear();
OleDbParameter param = new OleDbParameter("_protocolID",
protocol.ProtocolID);
m_command.Parameters.Add(param);

// open the connection and execute the update
m_connection.Open();
m_command.ExecuteNonQuery(); // THIS IS THE LINE THAT
CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError(e.Message, new StackFrame(true));
}
catch (Exception ee)
{
m_log.LogError(ee.Message, new StackFrame(true));
}
finally
{
m_connection.Close();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much
light.
Anyone know common causes for this exception?
Thanks for any help,
Steve


Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: BJ | last post by:
The application I have been developing is great except one flaw. When Windows NT shuts down, it doesn't send the Event to my application (if it did, it would close all of the open forms and kill an...
4
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
0
by: jwalton | last post by:
I have a new Web Service (written in C#) that is giving me major problems. The Consumer application is written in VB.NET. When executed totally on localhost it works 100%. When standalone Web...
1
by: JohnZing | last post by:
i tried to install asp.net forums all went ok, but after login i always get "Object moved to here." in firefox or "The page cannot be displayed" in IE when i hit refresh, the page loads fine. ...
5
by: rod.weir | last post by:
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise...
1
by: juergen | last post by:
Hi, there are many postings on this subject, I have read them put don't have an answer. I get these warnings: Cannot send session cookie - headers already sent in, but my php-scripts are okay. ...
16
by: Steve Chapel | last post by:
When I load the page <https://bugzilla.mozilla.org/attachment.cgi?id=237739with Internet Explorer 7 RC 1, I get the error "Object Expected" at line 174. When I click on the button, I also get the...
2
by: snester | last post by:
Hi, I am using visual studio 2005 and recently created a new web service project. I seem to have edited the global config file (inadvertently) somewhere along the line. All new projects I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.