Error Lost Connection when Exit Form (Tmyquery - Fatchall=false)

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
azis
Posts: 6
Joined: Mon 28 Feb 2011 05:26

Error Lost Connection when Exit Form (Tmyquery - Fatchall=false)

Post by azis » Fri 19 Apr 2013 10:29

I have a problem when exit form , because the object Tmyquery, on select properties patchall = false. under his following query

sds_view_mst_kend.Close;
//sds_view_mst_kend.FetchAll := False;
sds_view_mst_kend.SQL.Text := 'select * from mst_kendaraan';
sds_view_mst_kend.FetchAll := False;
sds_view_mst_kend.FetchRows := 5;
dbg_view_mst_kend.DataSource :=ds_view_mst_kend;
sds_view_mst_kend.Open;

then the following script in the form exit button
if LibMY.GetMessage_NY('sure will exit ...?') = True then
begin
c_db.Close;
Action:=caFree;
end
else
Action:=caNone;

please help me...

Thank's

Azis

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Error Lost Connection when Exit Form (Tmyquery - Fatchall=false)

Post by DemetrionQ » Fri 19 Apr 2013 12:25

Hello.

MyDAC distribution includes a demo project located in the "MyDacDemo" folder in Demos of MyDAC. Please check if the problem can be reproduced on this demo project.

azis
Posts: 6
Joined: Mon 28 Feb 2011 05:26

Re: Error Lost Connection when Exit Form (Tmyquery - Fatchall=false)

Post by azis » Fri 19 Apr 2013 22:54

Ok

Thank's

Azis

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Error Lost Connection when Exit Form (Tmyquery - Fatchall=false)

Post by DemetrionQ » Wed 24 Apr 2013 16:25

Hello.

In this case the 'Lost connection to MySQL server during query' error is an internal MyDAC error that is used for internal purposes.
Such MyDAC behaviour is correct, it is caused by specificity of working with not fetched data.
You will see the 'Lost connection to MySql server during query' error only if you run your application from the IDE.
You will not see this error when you run the executable file of your application.

Post Reply