I couldn't found out the reason of this error but I've found some way to avoid or weaken it.
You may extract code that works with statement's resultset and move it in a single method.
Example:
Code: Select all
procedure DoExecute;
begin
if Stmt.Execute('call proc();') then begin
DoProcessRS();
//if Stmt.GetMoreResults then
// DoProcessRS_2;
end;
end;
//-----------------------------------------
procedure DoProcessRS;
var Rs: IZResultset;
begin
Rs := Stmt.GetResultSet;
while (Rs <> nil) and (Rs.Next) do begin
S := S + Rs.GetStringByName('name')+'; '+#13+#10;
end;
MessageBox(Self.Handle, PChar(S), 'result 1', MB_OK);
end;