Hi miroslav,
First, try to simplify your code, i.e. get rid of the parameter stuff. This makes it easier to trace the error. Remove as much lines as possible.
Then, do not clear the recordset (MyQuery.Recordset := nil). TADOQuery is a delphi (borland) wrapper for the
ADO recordset object (or something like that) and takes care of all the underlying
ADO/
OLE stuff.
As my companions mentioned before, a select does not necessarily have to be protected by a transaction. Try to fiddle arround with the isolation level of the DML-statements to get the most rigid protection you need.
But first try to simplify your code.