EInvalidPointer on TmyQuery.Free

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Zebio21
Posts: 2
Joined: Mon 25 Aug 2008 14:35

EInvalidPointer on TmyQuery.Free

Post by Zebio21 » Mon 25 Aug 2008 15:02

Hello,

In my program i've a lot of TMyQuery who are genrated by code...

One of them give me a strage result when i'm trying to use the Free method...

this query is not dependant of another one but she is in a loop. In my loop, everething is ok, all the code works perfectly.

After the the first loop, when i free all queries, just this query create this EInvalid pointer...

Have you any idea?

I'm on Delphi RAD 2007 with MyDac 5.55.0.37

-----------------------------------------------------------------
Example of code

NumEtape := 2250 (for example)

for each record of query1 with no param
do something...

Request2.connection:=myconnection;
request2.sql.clear;
request2.sql.add('select title from dvdbase.dvd where num_etape=:NumEtape');
request2.parambyname('NumEtape').AsInteger := NumEtape;
request2.execute;
request2.first (assuming we have a record -> allways true)

do something...
and re do something....

at the end;
request1.free -> ok
request2.free -> EInvalidPointer

If i not use the free method, i can make all the loop i want but when the form is closed, the EInvalidPointer appears...

Zebio21
Posts: 2
Joined: Mon 25 Aug 2008 14:35

Post by Zebio21 » Mon 25 Aug 2008 15:04

One another point:

I've installed the source code of MyDac, and it's appears that the error is on the TCustomMyDataSet.InternalClose procedure

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 27 Aug 2008 12:12

I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including script to create and fill table.

Post Reply