I think that it is misunderstanding over this topic.
I write about ResultSets all the time.
DisableMultipleResults works with FIMultipleResults, not with ResultSets.
The same situation as in my last reply is in this code:
Code: Select all
var
MyQuery: TMSQuery;
with MyQyery do
begin
SQL.Add(
'PRINT ''xxx'''#13+
'SELECT 1');
Options.DisableMultiplyResults := True;
Open; // error
end; What I need is discard all ResultSets after reading the first ResultSet. I cannot use DisableMultipleResults for it.
My question: Can I use this code?
Code: Select all
type
TMyQuery = class(TMSQuery)
public
procedure Execute; override;
end;
procedure TMyQuery.Execute;
begin
inherited;
if HasNextResultSet then
begin
// free all next results, so also ResultSets
if FIRecordSet nil then
with TOLEDBCommand(FIRecordSet.GetCommand) do
begin
ClearIMultipleResults;
ClearIUnknownNext;
end;
end;
end;You have procedure ClearIUnknownNext; but you don't use it.
Instead of it you are using FIUnknownNext := nil;
Thanks
Roman