Re: Problem with ADODC.ocx control




"John" <newspost@xxxxxxxxxxxx> wrote in message
news:PJ6Xg.27618$b23.15049@xxxxxxxxxxxxx
I am working with a VB6 application that uses data environments. All of a
sudden the application is starting to randomly crash upon the closing of
the
form. The error is "The object invoked has disconnected from its clients."
Searching via Google has not really provided any real solutions. Any ideas
short of ripping the control out?

Thanks


[Warning! Most unsatisfactory response follows. <g>]

This error is one of the "uglies". Ugly because its exact cause is rather
simple (one of the threads in one of the components has become confused and
pulled the plug before its time), but the exact remedy will vary. (From a
component upgrade, to re-ordering your code).

Without more information of what you are doing, it is impossible to give any
specific recommendation, rather than just go back to basics.

Check the lifecycle of all your ADO objects. Doing anything creative?
Look for situations where you might have left a recordset open.
Look for situations where you might have other events pending when you
called Unload. (throw a DoEvents inside your unload).
Don't re-use the ADODC, ADODB.Connections or Recordsets.
What's the state of your ADO.Connection or the ADODC when you exit.
etc, etc...

If you do find you have a complicated processes of managing navigation in an
ADODC control, it is rather easy to replace it with code. Take a look at the
VB Data Form Wizard - it can generate two alternatives to using the ADODC.

I don't care for the ADODC myself, but it works well, as long as you don't
over-load it.

hth - but doubt it does. <g>
-ralph




.