cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error:Failed to open the connection while calling crystal report

Former Member
0 Kudos

I am getting the below error while calling the crystal report from dot net app. I am using OLEDB to connect to database. It is working perfectly in our DEV environment but as soon as I move it to production information after changing the logon information in the report it start giving the below error.

Failed to open the connection.C:\WINDOWS\TEMP{C2FD97D9-2ADE-41BB-88FF-23A4DF20BC6F}.rpt

Details: [Database Vendor Code: 17 ]

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naveen,

If you are using Oracle database, give read access to the ASPNET user on the folder conataining tnsora file (C:\Oracle\product\10.2.0\client_1\NETWORK).

I had a similar issue when i executed the FileMon utility I realized ASPNET user was getting access denied on this folder hence was not able to read the information required to connect.

Hope this helps

Regards

Nabeel

Answers (2)

Answers (2)

Former Member
0 Kudos

Are you able to connect to the database from the production machine using a UDL file?

If you haven't tried this, here's how to do it. Take these steps on the machine that is hosting the application. Create a new text file on the desktop. Change the file extension to ".udl" (without the quotes). Double-click on this to bring up the OLEDB connection test: start on the Provider tab and select the appropriate provider. Click "Next" and on the following tab enter your connection information. Click the "Test Connection" button to test the connection. Does it connect to the database successfully?

If you click on "OK" to close the dialog and then open the UDL file with Notepad, you should see an OLEDB connection string. In this string should be the same property values for server, database, user id and password which you are providing through your application. If they are not the same, modify your application to use these values.

If testing your connection information with the UDL file works but your application is still failing when using the same credentials, try profiling or tracing the database. Do you see connection attempts from the application? Are there any errors?

If you're impersonating, have you set up windows authentication correctly for both the application and the database?

Former Member
0 Kudos

Hi, Naveen;

You can get this error if there are permissions issues. Give the account that is running the web site (often the aspnet user account) full permissions to the windows\temp folder, and see if that helps.

Regards,

Jonathan

Former Member
0 Kudos

Thanks for quick response. I already checked all the permissions and they look OK.

Former Member
0 Kudos

Well I may be repeating but lets make sure whether you have selected the top system name by clicking on Location button? Also if you are using IIS5 then please make sure the temp file under

C:\Documents and Settings\<computer name>\ASPNET\Local Settings\

or

C:\Documents and Settings\<computer name>\Local Settings\Temp

location also have got the full control permission.

In case of IIS6, you can try running you application under different application pool.

Hope that helps!

AG.

Former Member
0 Kudos

I already checked the permissions as well and the problem still persists.

Former Member
0 Kudos

Hi, Naveen;

The error is almost always due to permissions, so let's be sure. If you right click the temp folder, what accounts are listed there? Which ones have Full access to the folder?

Or, if you are using IIS 6, what process is running the application pool?

Regards,

Jonathan

Former Member
0 Kudos

I have given Full access to ASP.NET as well as Server\Users on WINDOWS\TEMP folder.

Former Member
0 Kudos

Could you change the userName attribute in the processmodel tag of the machine.config and let me know?

I guess a restart of the machine would be required.

Rajesh