Re: OLE error 80040200 when assigning events of a TCustomADODataset pointingto a multi-select stored proc

From: Oliver Giesen (NO.ogware.SPAM_at_gmx.ALLOWED.net.INVALID)
Date: 05/05/04


Date: Wed, 05 May 2004 15:26:03 +0200

Oliver Giesen wrote:

> I have traced the problem down to the call to
> ConnectionPoint.UnAdvise in TCustomADODataSet.InternalClose but have no
> real idea how to proceed from there with my investigations.

I have now performed some further tracing and I think I have identified
a bug in the VCL. What appears to happen is that EnableEvents is being
called too early, i.e. before it has been decided which recordset will
be used:

In the TCustomADODataset.OpenCursor method, the recordset events are
initialized for the first recordset but only later on a check is
performed whether that recordset is closed and whether there might be
yet another one that is not. If this is the case the internal recordset
pointer (which was used to identify the ConnectionPoint for the events
in the first step) is reset to the first non-closed recordset. Now, when
in InternalClose it is attempted to unadvise the events again, this is
performed on a different recordset than the current one... this appears
to be in line with another observation I made, namely that the recordset
event handlers never fire for this specific stored proc.

Could this be the reason for the failure? How would I work around it?
My first thought was to unadvise the erroneously assigned events from
the first/inactive recordset and then readvise them to the current
recordset by calling EnableEvents again.

But how do I get back to that first recordset? How do I reset the iterator?

Cheers,

Oliver



Relevant Pages

  • Re: reset eof and bof flags
    ... you can't reset them, once you reach end or begin of recordset - they will be true, and you can check them any number of times ... how do you reset the eof and bof flags so that they don't error if you ... attempt a movenext or moveprev using a Dao recordset if the eof or bof has ...
    (microsoft.public.access.modulesdaovba)
  • Create a select all button
    ... recordset, which won't reset your pointer. ... The requery method re-evaluates which records should be in ...
    (microsoft.public.access.forms)
  • Select Query Help
    ... I want to extract weekly report from access dataabse into recordset. ... Scenario is as follows ... obviously Weeks should be reset when month changes. ... Its urgent plz help ...
    (microsoft.public.vb.database)
  • DATEPART FUNCTION
    ... I want to extract weekly report from access dataabse into recordset. ... Scenario is as follows ... obviously Weeks should be reset when month changes. ... Its urgent plz help ...
    (microsoft.public.access.queries)
  • Select Query Help
    ... I want to extract weekly report from access dataabse into recordset. ... Scenario is as follows ... obviously Weeks should be reset when month changes. ... Its urgent plz help ...
    (microsoft.public.inetserver.asp.db)