New user trying to set up a dynamic connection string
Posted: Thu Aug 16, 2012 12:46 pm
I was able to successfully make a new connection to an existing database by entering the following connection string in the New Connection interface in the report designer:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Q:\Engineering\Microvellum\Jobs 2012\mdb test\Manufacturing Data\Part Labels_NEST.mdb;
The problem is that the portion of the path "Jobs 2012\mdb test\Manufacturing Data" will change every time a report rendering is required. From what I've gathered from reading the forums, it's not possible to use a "variable" or a "parameter" through the New Connection interface but there is a way to make a dynamic connection string through the code tab. When I view the code tab, I see my connection string information as follows:
Unfortunately, I don't know the first thing about writing code behind the reports. So, is there any way I can modify this code to make the connection string dynamic? Perhaps by prompting the user to enter part of the connection string? Thanks, in advance, for your assitance.
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Q:\Engineering\Microvellum\Jobs 2012\mdb test\Manufacturing Data\Part Labels_NEST.mdb;
The problem is that the portion of the path "Jobs 2012\mdb test\Manufacturing Data" will change every time a report rendering is required. From what I've gathered from reading the forums, it's not possible to use a "variable" or a "parameter" through the New Connection interface but there is a way to make a dynamic connection string through the code tab. When I view the code tab, I see my connection string information as follows:
Code: Select all
Me.Dictionary.Databases.Add(New Stimulsoft.Report.Dictionary.StiOleDbDatabase("Nest", "Nest", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Q:\Engineering\Microvellum\Jobs 2012"& _
"\mdb test\Manufacturing Data\Part Labels_NEST.mdb;", false))