Why is the following code working flawlessly in Delphi 10.1 Berlin, while 'fdquery2.open' fails in 10.2.1 Tokyo with an error "Commands out of sync; you can't run this command now'. I need similar code in a real program eg. showing records in a dbgrid and in a separate process printing these records on a report.
Database MariaDB 10.1 (but also 10.2).
lblInfo.Caption:= 'Started, but not finished';
fdconnection1.Connected:= True;
fdquery1.open;
fdquery2.open;
lblInfo.Caption:= 'Started and correctly finished !!';
Fdquery1 and fdquery2 both uses the same connection FDConnection1.
Both queries calls the same stored procedure.
object FDConnection1: TFDConnection
Params.Strings = (
'User_Name=xxxxx'
'Password=xxxxx'
'DriverID=MySQL')
object FDQuery1: TFDQuery
Connection = FDConnection1
SQL.Strings = (
'call db.Test')
stored procedure test:
BEGIN
select
patient.nr from patient;
END
Note: Solutions like setting FetchOptions.Mode:= fmAll are due to performance issues not practical
Note: On different connections it works