MyQuery.Open takes too long

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sascha

MyQuery.Open takes too long

Post by sascha » Sun 14 May 2006 19:49

Hi!

I need to execute a query when a form is shown. The mySQL-Server is very slow. When MyQuery.Open is executed the form is blocked for some seconds.

Is there a possebility to execute the query in background and get notified (event?) when the data are fetched?

Thanks for Help,
and sorry for the poor Englisch, it's not my native language.

Best Regards,
Sascha

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 15 May 2006 08:46

You can try using FetchAll=False mode. The record set opens quickly and gets browsable and editable immediately after open, data is fetched on the users request (calling Next, Last, Locate methods etc.). But this mode has some restrictions. Please read MyDAC help for more information.
Another way of solving this problem is creating multithreaded application and handling background queries manually. But you have to use one MyConnection instance per thread.

Post Reply