Print Page | Close Window

Error Code 4060

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1130
Printed Date: 03 May 2024 at 11:53am


Topic: Error Code 4060
Posted By: joshuakk
Subject: Error Code 4060
Date Posted: 07 Aug 2007 at 1:05am
Hi guys,
 
I'm new to crystals XI and encountering a wield error here.
 
It worked before, but then I try to using the Crystal Report Designer and then paste in onto the .NET application, I get the following error:
 
Failed to open the connection. Details: [Database Vendor Code: 4060 ] Failed to open the connection. D:\Temp\temp_92b18c35-7d33-4e08-bbeb-2669d5f90fd0 {6DFC91BE-A0CA-43C4-9614-4E0112D37CA2}.rpt Details: [Database Vendor Code: 4060 ]
 
It works in the .NET designer and I confirmed the database connection is correct, I use
 

public static ConnectionInfo GetConnectionInfo()

{

ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = "ccsu-gmt-057";

connectionInfo.DatabaseName = "AHCP_tst";

connectionInfo.UserID = "dd";

connectionInfo.Password = "ss

return connectionInfo;

}

public static void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)

{

Tables tables = reportDocument.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)

{

TableLogOnInfo tableLogonInfo = table.LogOnInfo;

tableLogonInfo.ConnectionInfo = connectionInfo;

table.ApplyLogOnInfo(tableLogonInfo);

}

}

I wonder if it is because I copy and paste from the crystal designer? However, now nothing works for me so I'm a bit frustrated (It worked before I do the copy and paste changes. Can anybody tell me what's wrong with it? I'm currently using SQL Server 2000.




Replies:
Posted By: joshuakk
Date Posted: 19 Aug 2007 at 7:43pm
Just for your information, I resolved it by rebuilding the database !
 
Have no idea why this happens... after wasting a week's time.
 
Reporting Service won't have this kind of problems.
 
Josh


Posted By: BrianBischof
Date Posted: 20 Aug 2007 at 10:23pm
Glad to hear that you got the problem resolved. But I'm not sure where you heard that Reporting Services was perfect. After all, MS is rewriting it because so many people are complaining about it:

http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=623 - http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=623

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: wheeter
Date Posted: 03 Mar 2010 at 2:25pm
I struggled with this problem for many hours.  It ended up being a problem related to the server being 64-bit.

There are two versions of the ODBC on a 64-bit server.  The standard one that opens from Administrative Tools runs from C:\Windows\system32\odbcad32.exe.  The other one, which I was not aware of until now, must be executed directly from C:\Windows\SysWOW64\odbcad32.exe, and in my case needed to have the associated ODBC System DSN modified from there, as well.



Print Page | Close Window