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

  • Next message: Bryan Hall: "ADO and DBMemo's"
    Date: Wed, 5 May 2004 22:41:12 +0400
    
    

    > So, are you saying calling EnableEvents after open is a valid approach?
    It is working approach. Not the best (best is correcting OpenCursor
    procedure) but working.

    > Procedure example
    Procedure should have some statements and first one should return closed
    recordset (query that does not return records). For example:

    CREATE PROCEDURE test_proc AS
    CREATE TABLE proc_test (Col1 Int)
    INSERT INTO proc_test VALUES(1)
    SELECT * FROM proc_test

    P.S. When you call .NextRecordset check that it is not closed before
    assigning it to TADODataSet.Recordset - the code similar to

        while Recordset.State = adStateClosed do
        try
          FRecordsetObject := Recordset.NextRecordset(VarRecsAffected);
          if Recordset = nil then Abort;
        except
          DatabaseError(SNoResultSet, Self);
        end;

    //------------------------------------------
    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:409907e7@newsgroups.borland.com...
    > Viatcheslav V. Vassiliev wrote:
    >
    > > No, all properties should be set on initial recordset before Open().
    Next
    > > recordsets will inherit properties (such as cursor location).
    >
    > But apparently not the (contents of the) ConnectionPointContainer?
    > Otherwise this wouldn't have been a problem in the first place, would it?
    >
    >
    > > 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.
    >
    > So, are you saying calling EnableEvents after open is a valid approach?
    >
    >
    > I'm intending to report this to QC, but I'm still having trouble
    > producing a simplest case test scenario especially concerning the
    > characteristics of the stored procedure that is causing the multiple
    > recordsets being returned (with the first one being closed). Simply
    > having two select statements as in the example below does contrary to my
    > expectations not suffice to produce this symptom:
    >
    > declare @Temp int
    > select @Temp = 0
    > select * from wherever
    >
    > The procedure that alerted me to the problem is by far the most complex
    > we ever wrote and it is pretty hard to tell, what exactly might be
    > causing this. It uses temp tables and unions as well... any ideas?
    >
    > Cheers,
    >
    > Oliver


  • Next message: Bryan Hall: "ADO and DBMemo's"

    Relevant Pages

    • Re: access crashing after filter
      ... You have the Debug.Print line after the line that is causing the problem. ... What happens if you comment out the line that is causing the crash? ... using an ADO recordset and SQL server, the definition of variables (we can't ... recordset without specifically applying the filter. ...
      (microsoft.public.access.forms)
    • Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored
      ... are you saying calling EnableEvents after open is a valid approach? ... Not the best (best is correcting OpenCursor ... > recordset. ... You can try EurekaLog. ...
      (borland.public.delphi.database.ado)
    • RE: Cannot edit form
      ... It is definately the form that is causing the problem! ... The macro and table are fine. ... Recordset defined as Dynaset? ... > may be a conflict between the filter code and the ...
      (microsoft.public.access.forms)
    • ADO 2.7: Multiple-step operation generated errors
      ... I'm fairly certain I know what's causing this error. ... RecordSet and then disconnected. ... Is there any way to alter the record set schema to ... allow me to change the value in a field that has no back-end reality? ...
      (microsoft.public.data.ado)
    • KB832483 Problem
      ... Security patch install I believe is causing a problem when I return a recordset on an ASP page. ...
      (microsoft.public.sqlserver.server)