05-17-04, 07:08 #1Registered User
- Join Date
- May 2004
Unanswered: Change Database and server @ runtime
iam using vb6/sql server/ crystal reports 8.5.. my problem is that i want to change the server and database of the report at runtime .. how can i do this .. the server can be either the local pc or a remote server .. we donot use odbc to connect the application .. so the report should be connected without using odbc dsn .. how can i do this ..
05-17-04, 08:32 #2Registered User
- Join Date
- Mar 2004
try this one but not sure
rep.Load(Application.StartupPath & "\report\" & rptFileName)----
you can have report source path what ever u have or report itself here....
CrystalReportViewer1.ReportSource = rep
CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.S erverName = Application.StartupPath & "\Data\db1.MDB; Jet OLEDBatabase Password=" & DbPwd
try this and also
CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.. .. have other properties as well like passwrod ,server name, etc.
use this code in ur report viever form rep is reportdocument object
crystalreportviewer1 is report viever component
this is in vb.net
but i think it might help you in vb6
cuz i know nothing about vb6..
any way have a try..