cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal reports - Database error code 17

Former Member
0 Kudos

Hi,

I have been trying to debug a project and everything is perfect except for the report generation module.

For report generation i am using Crystal reports, However when i try to generate the report, the Below error is displayed. Could anyone Help me to rectify the error.

The Related coding is given below:-

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using CrystalDecisions.Shared;

using CrystalDecisions.CrystalReports.Engine;

using System.Data.SqlClient;

namespace msmReports

{

   public static  class util

    {

       public static void billById(string billno)

       {

           frmrptViewer frm = new frmrptViewer();

           frm.crv.ReportSource = new rptbill();

           ParameterFields fields = new ParameterFields();

           ParameterField field = new ParameterField();

           field.Name = "@billno";

           ParameterDiscreteValue value = new ParameterDiscreteValue();

           value.Value = billno;

           field.CurrentValues.Add(value);

           fields.Add(field);

           frm.crv.ParameterFieldInfo = fields;

           frm.Show();

       }

       public static void viewstock()

       {

           msmReports.frmrptViewer frm = new msmReports.frmrptViewer();

        

           frm.crv.ReportSource = new msmReports.rptStockview();

           frm.Show();

       }

    }

}

.

Please Check and reply if any solutions can be offerred.

Regards Noel......

Message was edited by: Don Williams

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

See this example:  C# Crystal Reports Dynamic Logon parameters

crystal report: Failed to open the connection

Please check the above threads after update the code.

Thanks,

DJ

Answers (3)

Answers (3)

former_member183750
Active Contributor
0 Kudos

The search string 'crystal net vendor code 17' returned teh following KBAs:

1676673 - Error: 'Failed to open the connection. Details: [Database Vendor Code: 17]' running a repo...

1676954 - Error: "Failed to open the connection. Details: ADO Error Code: 0x80004005" while logging ...

Please see if these help.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

former_member292966
Active Contributor
0 Kudos

Hi Noel,

You code doesn't show where the report is logging into the database.  You need to have the report log onto the database before it can use parameters or anything else.

The error message also indicates it failed to open a connection, indicating it can't connect to the database.  If your connection is being done in another part of code, make sure your connection string is correct.

Good luck,

Brian

0 Kudos

Have you searched your DB help file to see what Error 17 means? CR is simply passing the error generated by the client to you.

Don

former_member183750
Active Contributor
0 Kudos

Moved to: SAP Crystal Reports, version for Visual Studio

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter