Change database source via code
dear all,
i have a problem with my vb application,i have 2 similar database but i use one application.
so can i change the database source on crystal report by using vb code?
i use SQL server database and use Dsn for the connection string..
example:
i log on to my application using database A and i open my report using that database.
but when i log in again using database B and i open my report,it's still use database A.anyone can help me?
thanks alot
NB: sorry my english is very bad. ;)
best regards
martell
Re: Change database source via code
Changing the connection (close and open with a new connection string) to the apropriate DB should be enough (if they are truly similar in structure)
If you're using a ADODC you can change it's connection as well by
closing it and reopening with the other connection string.
You should focus on the connection used by your report.
Re: Change database source via code
do u knoe how to change the database via code in the report?
use this (report.Database.SetDataSource) ????
thanks