Ciper123
Ciper123

Reputation: 131

How to set crystal report's database location programmatically?

So I've got two PCs, both having a database named TKIC_Data_Storage.accdb in both of its AppData folder. I created crystalreport1.rpt in PC1 but the problem is that when i run it in PC2 the database will not be detected. How can I set a dynamic database location for the crystalreport.rpt during runtime?

Upvotes: 0

Views: 2152

Answers (1)

floele
floele

Reputation: 3788

I'd recommend making use of this SAP connection string utility or checking this sample code from SAP for changing the database connection at runtime. The actual code you need depends on the database type you connect to.

Various samples can also be found at StackOverflow: How do I change a Crystal Report's ODBC database connection at runtime?

Upvotes: 1

Related Questions