1
votes

My database created in integrated sql with VS12, work fine with my application. But, I unable to connect it with Crystal Report (CR for VS 13). My intention is, after I installed my app in target machine, the app will read the DBpath (where the DataBase has stored in target machine) from a text file and connect the DB. Same way all the reports should do. My connection string as follows

DbPath = System.IO.File.ReadAllLines(Application.StartupPath & "\FilepATHS.txt")(2)

Conn.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=" & DbPath & "\INVENTRY.MDF;Integrated Security=True;MultipleActiveResultSets=True"

Is there any way to connect my localDB to CR? Please let me know. I appreciate all of your suggestions. Thanks a lot.

1

1 Answers

1
votes

One option is to use the RAS api in the Crystal runtime to set the connection properties of the report on the fly.

An easier option is to set the report to use an ODBC DSN and simply set up that DSN on each machine (either automatically or manually).