At work we have 3 servers. One is the live db, one is a development db, and the other is for user testing.
When we develop a report, the database is for example pointing to xx.xx.xx.193. Then our live database might point to xx.xx.xx.54.
In my report, I've set my SQL connection to dev. But when put the report live, we don't want to go change every report's db connection in the report self. We want it to use the connection that is in the application.
I've tried the following code, but can't get it to work (connection1 is my SQL connection
Code: Select all
Report.Load(ReportShareName & "MyReport.mrt")
Report.RegData("DataSource1", connection1)
Report.Compile()
Report.Item("@myParameter") = Textbox1.Text
Report.Render()
Report.Show()
Report.RegData("Connection", connection1).
How can I set the connection string at run time ?
Another thing, when I hover over connection1, it shows that it is connected to the db I want, so that is not the problem.
I also looked at the example SQLParameters, but that didn't help much. I don't want to clear my datasource, because Im guessing I would need to write my query again somewhere... which is bit pointless I guess. Want to use the query that is in my report.
Thanx.