﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Crystal Reports \SF Connection Info</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 22:55:15 GMT</lastBuildDate><ttl>20</ttl><item><title>Crystal Reports \SF Connection Info</title><link>http://forum.strataframe.net/FindPost12873.aspx</link><description>Can anyone help me with establishing a connection to SF at runtime. I keep getting an error using the Crystal "ConnectionInfo" with the SF "ConnectionString"&lt;/P&gt;&lt;P&gt;Thanks Much.&lt;/P&gt;&lt;P&gt;Sample code&lt;/P&gt;&lt;P&gt;******************************************************&lt;/P&gt;&lt;P&gt;Private Sub ConfigureCrystalReports()&lt;/P&gt;&lt;P&gt;Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()&lt;/P&gt;&lt;P&gt;myConnectionInfo.DatabaseName = "MYDB"&lt;/P&gt;&lt;P&gt;myConnectionInfo.UserID = "Test"&lt;/P&gt;&lt;P&gt;myConnectionInfo.Password = "1234"&lt;/P&gt;&lt;P&gt;myConnectionInfo.ServerName = "MYServer"&lt;/P&gt;&lt;P&gt;northwindCustomersReport = New ReportDocument()&lt;/P&gt;&lt;P&gt;Dim reportPath As String = Application.StartupPath &amp;amp; "\" &amp;amp; "SubjectReport.rpt"&lt;/P&gt;&lt;P&gt;northwindCustomersReport.Load(reportPath)&lt;/P&gt;&lt;P&gt;myCrystalReportViewer.ReportSource = northwindCustomersReport&lt;/P&gt;&lt;P&gt;SetDBLogonForReport(myConnectionInfo, northwindCustomersReport)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)&lt;/P&gt;&lt;P&gt;Dim myTables As Tables = myReport&amp;#100;ocument.Database.Tables&lt;/P&gt;&lt;P&gt;For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables&lt;/P&gt;&lt;P&gt;Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo&lt;/P&gt;&lt;P&gt;myTableLogonInfo.ConnectionInfo = myConnectionInfo&lt;/P&gt;&lt;P&gt;myTable.ApplyLogOnInfo(myTableLogonInfo)&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;End Sub</description><pubDate>Tue, 04 Dec 2007 11:20:00 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Crystal Reports \SF Connection Info</title><link>http://forum.strataframe.net/FindPost12899.aspx</link><description>It sounds like your connection is not correct.&amp;nbsp; Were you sure to include the data base (Initial Catalog)?&amp;nbsp; If you ToString the SqlConnectionStringBuilder what does your connection string look like?&amp;nbsp; More than likely you are getting a valid error.</description><pubDate>Tue, 04 Dec 2007 11:20:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Crystal Reports \SF Connection Info</title><link>http://forum.strataframe.net/FindPost12896.aspx</link><description>Hey Ben,&lt;/P&gt;&lt;P&gt;I am getting a connection error,&lt;/P&gt;&lt;P&gt;Failed to open the connection.&lt;BR&gt;Failed to open the connection.&lt;BR&gt;C:\DOCUME~1\MICHAEL\LOCALS~1\Temp\rptSingleSubject</description><pubDate>Mon, 03 Dec 2007 16:04:15 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Crystal Reports \SF Connection Info</title><link>http://forum.strataframe.net/FindPost12885.aspx</link><description>What's the error you're getting?&amp;nbsp; It might be that you have to build the connection info like you are doing in your example, and to parse out the pieces of the connection string, you can use SqlConnectionStringBuilder.&lt;/P&gt;&lt;P&gt;Dim builder As New SqlConnectionStringBuilder(DataBasics.DataSources(String.Empty).ConnectionString)&lt;/P&gt;&lt;P&gt;The builder then has all the properties like DataSource, InitialCatalog, Username, Password, WindowsAuth, etc.</description><pubDate>Mon, 03 Dec 2007 08:56:31 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>