Print Page | Close Window

Connection to SQL Server

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
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=275
Printed Date: 27 Apr 2024 at 1:18am


Topic: Connection to SQL Server
Posted By: Vitaly
Subject: Connection to SQL Server
Date Posted: 05 Mar 2007 at 3:21am
I develope a web application under Win XP using C# (VS .NET 2003). The Crystal Report template data source is set OLE DB provider. I use MSDE 2000 (SP3). I make the application setup program using the Web Setup Project. The application work fine under Win XP, but the "logon failed" error arises under Win 2000 Proffesional and under Win 2000 Server. What is wrong?
 
Here is code:

ReportDocument crReport = new ReportDocument();string sTemplatePath = Server.MapPath(Request.ApplicationPath + "/" + m_sReportTemplate);

crReport.Load(@sTemplatePath);

TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();

ConnectionInfo tConnInfo = new ConnectionInfo();

tConnInfo.ServerName = "ServerName";

tConnInfo.DatabaseName = "DatabaseName";

tConnInfo.UserID = "UserId";

tConnInfo.Password = "Password";

foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crReport.Database.Tables)

{

crTableLogOnInfo = crTable.LogOnInfo;

crTableLogOnInfo.ConnectionInfo = tConnInfo;

crTable.ApplyLogOnInfo(crTableLogOnInfo);

}

CrystalReportViewer1.ReportSource = crReport;

CrystalReportViewer1.DataBind();




Replies:
Posted By: hilfy
Date Posted: 05 Mar 2007 at 10:49am

Is the SQL Server client installed on the Win2K machines?  Can they connect to the correct database through SQL Server tools that are not Crystal?  Is OleDB installed on those machines?

-Dell



-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window