Ok heres the run down guys. This is the final step in the program I have created so thanks to all that have helped me thus far.
1. Report was created in Crystal Reports XI, database connected fine through it yada yada yada all works fine.
2. Combined the Report into Visual Basic .net application (windows application not web) and have got everything to show up via CrystalReportViewer.
3. I have an ini file that has the path to the database in which the report should pull its data from (an access db) so I have created some coding (with the help of the vb people in the vb forum) code to read that ini file, pull the line that has the path to database on the server.
Now here is my question, how would I do it in VB to send the path of the database to the report, connect and display it in the report viewer.
So pretty much take the string in which I have placed the path and redirect the db the report connects to that path I have in the string.
Here is a code I have tried working with but it doesnt work:
Dim crTable As Table
Dim reportPath As New ReportDocument
For Each crTable In reportPath.Database.Tables
crTable.Location = Application.StartupPath & Path2(1)
Next crTable
myCrystalReportViewer.ReportSource = (Application.StartupPath & "sampleReport3.rpt")
Oh and im doing all that in the same place I am finding the path thats why I didnt declare Path2 again.
Thanks

Connecting to DB
cliffhanger9
I have successfully figured it out! thanks for all the help.
Hope to see you guys soon ;)
greenmind
An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.InvalidArgumentException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Error in File C:\Documents and Settings\mau\My Documents\Visual Studio Projects\Report\bin\sampleReport3.rpt:
Invalid table number.
The updated connection code:
'Loads Report and Connects to Database
reportPath.Load(Application.StartupPath & ".\sampleReport3.rpt")
For Each crTable In reportPath.Database.Tables
crTable.Location = Application.StartupPath & Path2(1)
Next crTable
myCrystalReportViewer.ReportSource = Application.StartupPath & ".\sampleReport3.rpt"
thanks
cfendya
huahsin68
In this line of code:
crTable.Location = Application.StartupPath & Path2(1)
What is Path2(1) set to Did you include the \ in that path also
Duie
For more info --> http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=249999&SiteID=1
I believe you helped me there aswell.