Print Page | Close Window

vs 2008 connect to a crystal command object

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=8327
Printed Date: 16 May 2024 at 11:50pm


Topic: vs 2008 connect to a crystal command object
Posted By: mc_tiger
Subject: vs 2008 connect to a crystal command object
Date Posted: 13 Nov 2009 at 8:04am
i have an odbc connection to a sybase database.
 
if i run a report from the crystal report viewer in vs 2008 that uses tables/views from the odbc connection those reports run fine.
 
if i run a report from the crystal report viewer in vs 2008 that uses the crystal command object, i get the following errror "Logon failed. Details: Cannot find DSN in connection string Error in File". 
 
the following is the code i use to apply the login info for the report/subreports.
 

Dim ci As New ConnectionInfo()
ci.DatabaseName = "DB"
ci.ServerName = "DSN"
ci.UserID = "user"
ci.Password = "password"
 
For Each tbl As CrystalDecisions.CrystalReports.Engine.Table In tbls
     Dim tli As TableLogOnInfo = tbl.LogOnInfo
     tli.ConnectionInfo = ci
     tbl.ApplyLogOnInfo(tli)
Next
 
Again this works on all other reports just not on the crystal command object.
 
I am using vs 2008 and crystal reports X.
 
Thanks



Print Page | Close Window