Board index » delphi » Creating and using form inside thread hangs main window till thread completes

Creating and using form inside thread hangs main window till thread completes

When I spawn a thread to use a data module to perform SQL queries, I find
that the main window remains frozen and unpainted until the thread is
completed. I've tried using synchronize without success. Given this
(minimal) information, can anyone point out something obvious that I'm doing
wrong?

Many thanks,

Scott

 

Re:Creating and using form inside thread hangs main window till thread completes


Quote
> When I spawn a thread to use a data module to perform SQL queries, I find
> that the main window remains frozen and unpainted until the thread is
> completed. I've tried using synchronize without success. Given this
> (minimal) information, can anyone point out something obvious that I'm doing
> wrong?

Scott,

this sounds like you are executing the query in the context of the main thread, not your
secondary thread like you believe. Note that the thread needs to create its own TSession
component, the queries DBSession property has to be set to this session.

Peter Below (TeamB)  100113.1...@compuserve.com)

Other Threads