Page 1 of 1
Commands out of sync; You can't run this command now
Posted: Wed 03 Oct 2012 20:45
i ve go delphi xe and mydac 7.2.8 and iv got a :Tmyquery : select * from matable where myindex = toto in a table that is not big 2000 or 3000 record but this Tmyquery is really often call by my software and i ve got the error 'Commands out of sync; You can't run this command now'
why
the code
Txat2.Close;
Txat2.ParamByName('session_id').Value:=sessionid;
Txat2.Execute;
if Txat2.RecordCount >0 then .....
Re: Commands out of sync; You can't run this command now
Posted: Thu 04 Oct 2012 08:57
by AlexP
hello,
There are many possible reasons for this error. It is possible if you're executing more than one SELECT query in one dataset.
Please describe in more details the whole case where the error occurs.
Re: Commands out of sync; You can't run this command now
Posted: Thu 04 Oct 2012 10:38
Hello,
i ve got a Twebmodule who is waiting to receive xml file when an xml file arrive it start a procedure that search informations and iv got the problem when 2 simultaneous xml file arrive in the webmodule and launch the procedure who is not finished
Re: Commands out of sync; You can't run this command now
Posted: Mon 08 Oct 2012 09:41
by AndreyZ
The "Commands out of sync; You can't run this command now" error occurs in this case because you are trying to execute several commands through one connection. To solve the problem, you should create the TMyConnection and TMyQuery components dynamically in your procedure. This way, each call of your procedure will work with its own components and there will be no simultaneous command calls through one connection.