Board index » delphi » TAdoDataSet - "CommandText does not return a result set" error
Keith G Hicks
![]() Delphi Developer |
TAdoDataSet - "CommandText does not return a result set" error2005-06-09 04:49:33 AM delphi209 I have a TAdoDataSet (dstRptTemp) that I am setting up in code with a stored procedure for handling report data. The CommandType property is set to cmdStoredProc. Here's my code: dstRptTemp.Active := false; dstRptTemp.CommandText := 'sp' + sReportName + ';1'; //sReportName is the name of the report the user wants to run (the backend procedure has the same name with an 'sp' prefix) dstRptTemp.Parameters.Clear; (* Set up parameters depending on which report was run. *) if slParamPages.IndexOf(tbShtActiveStatus.Name) <>-1 then // parameters are set by the user on various pages of a page control depending on the report being run. dstRptTemp.Parameters.CreateParameter('sActive', ftString, pdInput, 1, radGrpActiveStatus.EditValue); if slParamPages.IndexOf(tbShtCustOrVend.Name) <>-1 then dstRptTemp.Parameters.CreateParameter('sCustOrVend', ftString, pdInput, 1, radGrpCustOrVend.EditValue); dstRptTemp.Prepared := true; dstRptTemp.Active := true; Everything runs fine until the last line where I get an error "dstRptTemp: CommandText does not return a result set." Now this does work if I set it all up manually in the properties. If I set up the paraemters and set Active = true I can view the report from the design environment. So I know my stored procedure is fine. The only difference I can see is that there is another parameter "@RETURN_VALUE" that is automatically put in when I do it manually. I have no need for this and do not have one set up in the stored procedure itself. Any ideas as to what would cause this error? Thanks, Keith |