Re: ADOQuery in thread hangs, Solved !!!!!!!!!



Hello!

I finally solved the problem (I hope) after 10 hours of work.

For those not interested in reading the hole story the problem was that ADO
queries stopped working in my TThread.

It seems like the problem is the Max() function in SQL!

If I run the query "Select Max(MyID) From MyTable" from my main program,
efter this ADOqueries didn't work any more in my thread. The thread just
hung when trying to do a ADOQuery.SQL.Add(...)

After rewriting the select To "Select MyID From Mytable Order By MyID Desc"
in the main program and picking the first returned record (giving the same
result as above) everyting works!

Can anyone explain this strange error? Of course my workaround is not wery
good for large tables....

Regards, Mikael



.