Re: ADOQuery in thread hangs



Yes I create a TADOQuery local to the thread. In the thread I don't have any
ADOConnection, I just use a connectionstring directly in the ADOQuery.

Mikael


"Brian Bushay TeamB" <BBushay@xxxxxxxxx> skrev i meddelandet
news:n897m2hao5o1ff76lq199v79aav5oqtvtu@xxxxxxxxxx
Hello!

Having a real nightmare problem at the moment. In my main program I have a
ADOConnection and several associated ADOQuerys. They are all connected to
an
Access file.
Then I have a TThread containing it's own ADOQuery, connecting to the same
Access file doing some selects. I can run the thread as many times as I
want
without any problem. If I then do an Insert statement in the main program
a
strange thing happenes. The next time I'm running the thread it DIES at
the
first line where I do ADOQuery.SQL.Add...

ADOQuery.Close;
ADOQuery.SQL.Clear;
ADOQuery.SQL.Add('Select * From Units Where UnitID = ' +
IntToStr(UnitRecord.UnitID));
ADOQuery.Open;

The above is sample code from the thread, if I trace it and press F8 at
the
Add line it just dies there, no exceptions what so ever.

Running Win XP Pro and Delphi Studio 2006

Please any ideas?


When you use a thread you need to create the TadoQuery as well as its
connection
in the thread. You didn't indicate if that is what you are doing.
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx




.



Relevant Pages

  • Re: ADOQuery in thread hangs
    ... I just use a connectionstring directly in the ... Having a real nightmare problem at the moment. ... Then I have a TThread containing it's own ADOQuery, ... Access file doing some selects. ...
    (borland.public.delphi.database.ado)
  • Re: ADOQuery in thread hangs
    ... EditSchedulesForm is a maintenance form and it adds a procedure hook for all ... I just use a connectionstring directly in the ADOQuery. ... Add line it just dies there, ...
    (borland.public.delphi.database.ado)
  • Re: common question
    ... AdoConnection to the client connectionstring. ... But is this safe? ... Otherwise you need to connect again the adoconnection. ...
    (borland.public.delphi.database.ado)
  • ADO connection causes a freeze
    ... I'm using Windows XP SP2 and Delphi 7. ... creation of the ConnectionString works fine - including the testing of the ... It is not the file - making a new project with an ADOConnection causes the ...
    (borland.public.delphi.database.ado)
  • Re: How can i empty ConnectionString of ADOConnection while its connected?
    ... I want empty ConnectionString property of ADOConnection while its ... answer: for security issue. ... Memory Dump utilities and passwords on the connection string. ...
    (borland.public.delphi.database.ado)