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

From: Viatcheslav V. Vassiliev (support_at_oledbdirect.com)
Date: 05/05/04


Date: Wed, 5 May 2004 18:50:28 +0400

No, all properties should be set on initial recordset before Open(). Next
recordsets will inherit properties (such as cursor location).

> Looking good so far. I'm now able to catch all events. Furthermore, no
> errors and even MemProof seems content... ;)
There should be no memory leaks because TADODataSet is not reference
counted - recordset should hold pointer to TADODataSet that is set in
Advise() - this interface (IUnknown(TADODataSet)) should be released in
Unadvise() call.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Oliver Giesen" <NO.ogware.SPAM@gmx.ALLOWED.net.INVALID> ???????/???????? ?
???????? ?????????: news:4098f3a0$1@newsgroups.borland.com...
> Oliver Giesen wrote:
>
> > > If so, try change OpenCursor procedure this
> >
> >> way:
> >>
> >> In InitializeRecordset sub-procedure comment line "EnableEvents;"
> >>
> >> In procedure body place "EnableEvents;" after except...end;
> >
> > Yes, but that's up to Borland.
>
> Actually it looks like there's quite a bit more of potential for
> disaster in there. After all, pretty much *everything* that happens in
> InitializeRecordset is ultimately referring to the wrong recordset, or
> isn't it?
>
>
> > Do I *have* to unadvise? Would it maybe be sufficient if I just called
> > EnableEvents again after Open (or rather SetActive(True)) in my
> > descendant? Trying already...
>
> Looking good so far. I'm now able to catch all events. Furthermore, no
> errors and even MemProof seems content... ;)
>
> Still being wary though...
>
> Cheers,
>
> Oliver



Relevant Pages

  • Re: RETURN_VALUES ??? done... What have I gained?
    ... that where closer to ADO native properties. ... You use TadoDataset when a recordset is returned and TadoCommand ...
    (borland.public.delphi.database.ado)
  • Re: close recordset before nothing
    ... If you do not do this, then you might experience a memory leaks. ... there is no garbage collector as in .NET, so most likely recordset resources ...
    (microsoft.public.data.ado)
  • Re: close recordset before nothing
    ... If you do not do this, then you might experience a memory leaks. ... there is no garbage collector as in .NET, so most likely recordset resources ...
    (microsoft.public.vb.database.ado)
  • is Nothing vs = Empty
    ... I want to put code in my routines to be sure that a recordset is never left ... unclosed, to prevent memory leaks, as I've been advised. ... But sometimes the recordset shows a value of "Empty" when I hover ... over it in the debugger, and in those cases the code is executed and I get ...
    (microsoft.public.access.formscoding)
  • Re: is Nothing vs = Empty
    ... unclosed, to prevent memory leaks, as I've been advised. ... What about if the recordset is not Nothing but isn't open? ... paranoid coder pattern I see is more like this: ... On Error Goto Err_Handler ...
    (microsoft.public.access.formscoding)