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.
Edited by joshuakk - 07 Aug 2007 at 1:12am