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
- Previous message: David Lewis: "Re: adoquery thread"
- In reply to: Oliver Giesen: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Next in thread: Fabio Dell'Aria: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Reply: Fabio Dell'Aria: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: David Lewis: "Re: adoquery thread"
- In reply to: Oliver Giesen: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Next in thread: Fabio Dell'Aria: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Reply: Fabio Dell'Aria: "Re: OLE error 80040200 when assigning events of a TCustomADODatasetpointingto a multi-select stored proc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|