cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to open the connection

Former Member
0 Kudos

In my web application i am genarating reports. I am using crystal reports 2008 with VS2010 and the database is SQL server 2008. There is no issues genarating reports in my local machine. After i host my application on the server, I am getting error "Failed to open the connection." while i run the report. I have installed crystal report run time files version 13.0.2.

Thanks in advance.

 

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Hi Donavon,

CR 2008 is not compatible with VS 2010. Use either vs 2005 or vs 2008.

On your server,

- If you are using CR 2008 (ver 12.0) on your dev machine, you need the same version of runtimes to be installed on the server. Check your web.config for CR assembly version. version 13 is Crystal Reports for VS 2010 not CR 2008.

CR 2008 runtimes are available here:http://scn.sap.com/docs/DOC-27917

- Check if you could connect to the database (which the report is trying to connect to)

- Check if the driver / provider / client used by the report on dev machine is present here also,

- If its ODBC connection, check if the DSN is of the same name.

- If the app targets X86, make sure that the DSN is 32 bit and the DB client as well.

- Bhushan

Senior Engineer

SAP Active Global Support

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Getting started and moving ahead with Crystal Reports .NET applications.

Former Member
0 Kudos

Thanks you for your quick suggestion. You are right; I just used crystal reports 2008 for design purpose. I am actually using Crystal reports for VS2010.

     ·     “If the app targets X86, make sure that the DSN is 32 bit and the DB client as well.”

       How can I find if my DSN is 32 bit?

  •   I have created a system DSN using Administrative tools and connected this data source in the reports.  In my application i am passing the credials using crystal reports connection string.

add key="CrystalReportsConnection" value="data source=10.50.74.92;initial catalog=MTACC_INJURY_DEV2;Uid=intranetmtacc;pwd=mtaccintranet;Pooling=True;Persist Security Info=false;Min Pool Size=1;Max Pool Size=50;Connect Timeout=60;"

   Do I still have to create a system DSN in the server?

former_member188030
Active Contributor
0 Kudos

Is this machine 64 bit? (where you have created this DSN from administrative tools).

If yes, then the DSN you have created is 64 bit. for 32 bit create a DSN from C:\windows\SysWoW64\odbcad32.exe.

- Bhushan

Former Member
0 Kudos

I tried your suggestion there was no difference. I have narrowed down the issue. If the report has a parameter and set the connection type to trusted in crystal report, I am getting "Failed to open Connection" error. If I use the same UserId, password as in my ODBC connection instead of trusted connection the report works but prompt for db password (I am passing the password in the SetDatabaseLogon in the .net code). I very much appreciate any suggestion regarding this issue.

Answers (0)