SAP Knowledge Base Article - Public

1324127 - Error: Failed to retrieve data from the database


Stored procedure connected reports migrated to another similar environment are failing with the following error:

“Failed to retrieve data from the database”


"Database Connector Error: '24000: [Microsoft] [ODBC SQL Server Driver] Invalid Cursor state'"


  • Crystal Reports 2008
  • Crystal Reports 2011
  • Oracle, SQL Server databases  
  • Stored procedure with mixed type (string, number, date, etc.) multiple  parameters

Reproducing the Issue

  1. Open report connected to multiple parameters stored procedure in Crystal Reports Designer
  2.  Click “Database” in the top menu and select “Set Datasource Location…”
  3. Select an identical Stored Procedure in “Replace with” window and update the connection
  4. Refresh the report, fill all parameters prompts, click OK and the error message appears


The order of parameters saved with the report does not match the original parameter's order in the stored procedure.


  1. Create a blank report connected to the same stored procedure and look at the original order of stored procedure parameters in Field Explorer.
  2. Open failing report in Crystal Reports Designer
  3. Right-click any parameter in Field Explorer
  4. Select "Set Parameter Order.." and move parameters to match the original order



StProc, StorProc, parameter prompts, parameter sequence, imported report , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem


Crystal Reports 2008 V0 ; SAP Crystal Reports XI ; SAP Crystal Reports XI R2