You are not logged in.
Pages: 1
Hi AB i got an Exception in SynOLEDB - TOleDBStatement.ExecutePrepared
mr was nil after Query
Here is my Patch (Line 1997 ff)
if not OleDBConnection.OleDBProperties.fSupportsOnlyIRowset then begin
// use IMultipleResults for 'insert into table1 values (...); select ... from table2 where ...'
res := fCommand.Execute(nil,IID_IMultipleResults,fDBParams,@fUpdateCount,@mr);
if assigned(mr) and (res=E_NOINTERFACE) then // <-- PATCH itSDS
OleDBConnection.OleDBProperties.fSupportsOnlyIRowset := true else begin
repeat
res := mr.GetResult(nil,0,IID_IRowset,@fUpdateCount,@RowSet);
until Assigned(RowSet) or (res <> S_OK);
end;
end;
Rad Studio 12.1 Santorini
Offline
For what OleDB provider and what kind of statement you got nil there? May be you need to set ExpectResults to false?
In any case i think we should throw in else block
if assigned(mr) and (res=E_NOINTERFACE) then // <-- PATCH itSDS
OleDBConnection.OleDBProperties.fSupportsOnlyIRowset := true else begin
repeat
res := mr.GetResult(nil,0,IID_IRowset,@fUpdateCount,@RowSet);
until Assigned(RowSet) or (res <> S_OK);
end else
raise EOleDBException.CreateUTF8('%s.Statement does not return rowset',[self]);
Isn't it?
BTW - github pull request much more readible then forum post At last wee see a diff there...
Offline
@Mpv ty for your answer, but my patch does not solve the underlying problem i found out yesterday
Im Doing a nested Query with TOleDBMSSQL2012ConnectionProperties Calling ExecuteInlined.
The Schema is
var
LRows1, LRows2 : ISQLDBRows;
begin
...
LRows1 := ConnectionProperties.ExecuteInlned(SomeSQL, true);
While LRows1.Step do begin
.. Do Something with LRows1
LRows2 := ConnectionProperties.ExecuteInlined(AnotherSQL, true);
if LRows2.Step then
.. Do Something with LRows2
end;
if ConnectionProperties is TOleDBMSSQL2012ConnectionProperties then i got Exception in the Second ExecuteInlined
if ConnectionProperties is TSQLDBZEOSConnectionProperties then it works (MySQL - Server)
Seems to be something wrong with the TOleDBMSSQL2012ConnectionProperties Implementation reusing the internal Connection.
Any Idea ?
Rad Studio 12.1 Santorini
Offline
Pages: 1