Dont freeze app while connecting

Dont freeze app while connecting

Postby ben » Wed 01 Jun 2005 20:40

Hello,

when I call Connect() the application freezes until it returns an error msg. How can I have a working application without freezing the app?

Any redirection?
ben
 
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Postby Ikar » Thu 02 Jun 2005 07:31

Use TThread descendant. Refer to Delphi help for details
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby ben » Fri 03 Jun 2005 19:54

everything looks ok with TThread but there is a small problem.
If I call Connect() inside a thread and then I dont wait to connect and I close the form, the application is still in memory.

Although I have managed to stop the thread OnClose (or OnCloseQuery) it doesnt work. Maybe I need to cancel the connection attempt also, something like MyConnection.Abort() but... there is no Abort or a related function to stop the component from trying to connect.
ben
 
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Postby Ikar » Mon 06 Jun 2005 14:05

MySQL doesn't give a possibility to break a connection at the time of its establishing. Probably, if you decrease a value of ConnectionTimeout it will help you.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components