Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the database at run time for Crystal Reports

Status
Not open for further replies.

shailesh32

Programmer
May 1, 2003
7
IN
How do we change the database at runtime for crystal reports. I declared rpt1 as Craxdrt.Report
And at runtime i would like assign a different database to the rpt1.

Thanks in advance
 
To change location of db file for specific table
rpt1.Database.Tables(1).Location = "c:\abc.mdb"
Or
Assign recordset to table, recordset can be popultated from
any datasource
e-g assume Rs as ADODB.Recordset
rpt1.Database.Tables(1).SetDataSource Rs
 
or . .

CrxRpt.Database.Tables(1).SetLogOnInfo "Server", "Database", "UserName", "Password"
CrxRpt.Database.Tables(1).Location = "Database.dbo.TableName"

'Using the CRViewer Control
crvRPTView.ReportSource = CrxRpt
[flowerface]

"All I ask is the chance to prove that money can't make me happy." - Spike Milligan
 
It is worth noting that there is a separate Crystal Reports forum too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top