Print Page | Close Window

ODBC Query

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=1483
Printed Date: 14 May 2024 at 8:09am


Topic: ODBC Query
Posted By: jain_rohit7
Subject: ODBC Query
Date Posted: 10 Oct 2007 at 5:42am

Hi,

 

We have an urgent issue related to Crystal Report in our application. We want to use ODBC connection for connecting to the SQL server instead of currently used OLEDB connection, to make the connection dynamic. We have created the DSN for the server connection and also mapped the report to the created DSN.

 

When we run the report in the crystal report environment, it runs fine. But when we try to run the same through our VB.NET application, it asks for the User Id and Password for SQL Server authentication which is already provided in the DNS. And, even after entering the required details, we are unable to get the report displayed and the control is redirected to the same page.

 

Any inputs for the above issue will be highly appreciated



Replies:
Posted By: wattsjr
Date Posted: 15 Oct 2007 at 11:55am
Hi jain_rohit_7,
 
Your problem looks similar to one that I had.  When running a report through VB.NET you have to login to each table used in the report.  This may explain why you keep seeing thee ODBC Login screen. 
 
Logging into the tables is done through a "For each" looping process using the ReportDocument oibject to retrieve the tables in the report and log into them. 
 
Brian shows you how to do this in his book "CRYSTAL REPORTS .NET Programming" in Chapter 17 - pages 357-360.
 
I hope that this helps,


-------------
-jrw



Print Page | Close Window