Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Connect to different MDB file Post Reply Post New Topic
Author Message
wasouthpnt
Newbie
Newbie


Joined: 27 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote wasouthpnt Replybullet Topic: Connect to different MDB file
    Posted: 27 Oct 2008 at 7:36am
I have 100 MS Access databases.  All have the same table layout.  Each one is for a different customer.  My question is this:  After I create a .NET 2008 Windows Crystal Report project that connects to one of the databases, how can I then at runtime change the database (mdb file) that the report uses?  I searched everywhere in the code that is created by VS 2008 and could not find any datasource setting that points to the mdb file.  Please let me know if this is possible and what is the preferred method.
IP IP Logged
wasouthpnt
Newbie
Newbie


Joined: 27 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote wasouthpnt Replybullet Posted: 27 Oct 2008 at 8:12am
I have found I can do this in the Form Load event, is this acceptable?

CrystalReport11.DataSourceConnections[0].SetConnection("C:\\DBS\\Customer X\\CustomerX.mdb", "", false);

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.