ADO Error Operation Canceled in Delphi

I have the following code to execute a sql stored procedure that returns multiple result sets and then reads this result from a stream. For reference: it returns xml blocks as strings, and then converts them to full xml. It has been working for more than a year, but now I have a case that leads to an error message: the operation was canceled. The debugger shows: Project x raised an EOleException exception class with the message Operation canceled. I have no idea what causes this. Any help or suggestions would be great.

const
  adExecuteStream = $00000400; //Indicates that the results of a command execution should be returned as a stream. 
var
  objCmd, InputStream, XML, XSLT, Template, Processor, objConn, strmResults : Variant;
  ATStreamClass : TMemoryStream;
  Adapt : TStreamAdapter;
  OutputStream: IStream;

objCmd := CreateOLEObject('ADODB.Command');
objCmd.ActiveConnection := dmABaasMock.dbRaAndm.ConnectionObject;
objCmd.CommandType := adCmdText;
objCmd.CommandText := <sp proc name with params>;
strmResults := CreateOLEObject('ADODB.Stream');
strmResults.Open;
objCmd.Properties['Output Stream'] := strmResults;
objCmd.Execute(EmptyParam, EmptyParam, adExecuteStream); // HERE COMES THE EXCEPTION
strmResults.Position := 0;
xmlMemo.text := strmResults.ReadText;
+3
source share
2 answers

, , .
, , :

  • , ? ( ADO), DB, proc,...
  • SQL?
  • , ADO , DataSets ADODB.Stream OleObject. Variant , ? ...
+2

- ADO .
100% , (, ), , :

.NET ADO Integrated Security="True", ( Delphi, ), Integrated Security="SSPI".

, ( Win32 Delphi , .NET) .

-

+1

Source: https://habr.com/ru/post/1764166/


All Articles