how to Disconnet while Connecting on Thread

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
munggaran
Posts: 18
Joined: Sat 11 Apr 2009 08:50

how to Disconnet while Connecting on Thread

Post by munggaran » Mon 22 Jun 2009 01:39

Hello,

I was connecting my TUniConnection under Thread because I don't want to freeze the form when the connection start, but I don't know how to cancel the connection itself just incase if user want to cancel without waiting until the connection timeout.

then I've tried to execute .Disconnect method but the does not affect the connection.

any idea ?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 22 Jun 2009 06:43

Please specify which DBMS you use.

munggaran
Posts: 18
Joined: Sat 11 Apr 2009 08:50

Post by munggaran » Mon 22 Jun 2009 06:50

I'm sorry, it's PostgreSQL

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 22 Jun 2009 09:59

UniDAC does not support cancelling a connection. You can just "forget" about the thread if user has canceled the operation. Thread will wait until the connection is established or exception is raised. Then you can end the thread. (Create new TUniConnection component for each connect).

Post Reply