Print Page | Close Window

dynamically set datasource location crystalreports

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=755
Printed Date: 02 May 2024 at 11:00am


Topic: dynamically set datasource location crystalreports
Posted By: priyavenkat
Subject: dynamically set datasource location crystalreports
Date Posted: 28 May 2007 at 3:41am
Hai,
 
I am using Visual basic 6.0 and msaccess as backend.
I am creating reports using crystal report version 10.0 and connect database using ODBC DSN connection property. and i call my report through vb code. it will work my machine very perfectly.  but when i setup this porject in my client machine in different database path. The report will not work. it asks database path.
 
So, how can i dynamically set my database dsn connection string thruogh vb 6.0?
 
Now my code is,
Dim CrxApp As New craxdrt.Application
Dim crxRpt As craxdrt.Report
 
Set crxRpt = CrxApp.OpenReport(App.Path & \Reports\studentmaillist.rpt")
crxRpt.Database.Tables(1).Location = "tblStudentInfo"
CRViewer1.ReportSource = crxRpt
CRViewer1.ViewReport
 
please help me. It's very urgent one.


-------------
Thankas and Regards,
Priyavenkat



Print Page | Close Window