When creating my Crystal Report I obviously set up a database and server connection that I use for development.
What I want to do now in my VB application is to dynamically set the database and server name to use with the reports. I have these values as the strings varServer and varDatabase.
Anyone know how to go about doing this?
Thanks in advance.
P.S I have tried several online solutions but am having trouble with VB6.
Great Work! thanks For the code! I change it a bit though because this part was not working:
It had an error that could not find object
So I did it like that:
This link has all information you want to know.
UPDATE: Here is a minimum working sample for integrated authentication with SQL Server. You should use the ConnectionProperties of the table object to set connection parameters.
One can also set the default provider for the report by adding this code bit.
What version of crystal are you using?
In the .net world, I generally pass the dataset to the report as emoreau says here.
That way, your connection is set from code rather than crystal and can be stored in a global connection property. However, that's .net. I'm thinking that either the version of crystal you have should have similar functionality OR Emoreau may have an example of how to do it in VB6 in the version you're using.
Hope that get's you started.