Error: Invalid Argument provided. Failed to retrieve data from the database. Error in File ReportName.rpt: Invalid argument for database.

Error:

When printing a Crystal report from Dynamics Report Manager (DRM), you receive the following error message:

Error: Invalid Argument provided.

Failed to retrieve data from the database.

Error in File (ReportName).rpt:

Invalid argument for database.

Cause:

The System DSN set up for Crystal reports is using a SQL Native Client Driver instead of a SQL Server Driver.

Resolution:

  1. Open the ODBC Data Source Administrator (32-bit) window.
    1. Go to your Start page and start typing ODBC Data Source Administrator (32-bit).

  2. In the ODBC Data Source Administrator (32-bit) window, click Add.
  3. In the Create New Data Source window, select SQL Server, and then click Finish.
  4. Enter a Name and Description, select the Server Microsoft Dynamics GP (GP) is on, and then click Next.
  5. Click With SQL Server authentication using a login ID and password entered by the user, enter sa for Login ID, enter sa’s Password, and then click Next.
  6. Unmark Use ANSI quoted identifiers, unmark Use ANSI nulls, paddings and warnings, and then click Next.
  7. Unmark Perform translation for character data, and then click Finish.
  8. In the ODBC Microsoft SQL Server Setup window, click Test Data Source.
  9. In the SQL Server ODBC Data Source Test window, verify it says TESTS COMPLETED SUCCESSFULLY!, and then click OK.
  10. In the ODBC Microsoft SQL Server Setup window, click OK.
  11. Log into GP as sa.
  12. Go to Microsoft Dynamics GP | Tools | Setup | Dynamics Report Manager | System Settings.
  13. In the Dynamics Report Manager System Settings window, click the Crystal tab, and then select the new DSN Name you created above.
    1. If you have more than one company you run this report in, mark the Switch Data Source to use SQL Company Database checkbox.
    2. If you need to Override Report Credentials, enter sa (for example) and sa’s password.

  14. Click OK.
  15. If you specified a DSN Name specific to the report(s) in DRM, go to Reports | Dynamics Report Manager | Dynamics Report Manager Explorer.
  16. In the Dynamics Report Manager Explorer window, select a report, and then click the Edit Report button.
  17. In the Report Maintenance window, click Connection.
    1. Unmark the Override Global Connection to use the default values you specified in Step 13 above.
    2. Or, select the new DSN Name you created above.