I have only one problem, since I am connecting to the DB inside the thread, I lose a lot of time in estabilishing the connection and a very little time to execute the thread:
Code: Select all
procedure TSDACBackgroundThread.Execute;
begin
// coinitialize part
FData.MSConnection.Connect; // takes "2 seconds"
FData.MSQuery.Execute; // takes "5 milliseconds"
FData.MSConnection.Disconnect;
end;Is it a way I can pass an already existing connection or am I forced to call TMSConnection.Connect INSIDE the thread?