| niravmehta@gmail.com 2006-01-27, 4:01 am |
| Hi,
I have the following environment:
Visual Basic 6 service pack 6
Microsoft Access 2003 database
Crystal Reports 8.5
The application at login time asks the user to select the database s/he
wishes to connect to (since each company has a seperate mdb file). All
the mdb files will be placed in the "data" folder. The application path
is not fixed since the application will run from a pen drive and thus
may change from time to time, from machine to machine.
My problem is that from the application when the user wishes to print a
report I dont know what code is to be written to tell crystal to
connect to the database the user is logged in to. Instead right now
crystal is connecting to the database that was used to design the
report.
I am sure there is a way around this since I have seen applications
which pass the database info at runtime to crystal but the problem is I
dont know what code is to be written for this. Also I dont know if I
have to create a system DSN since the application path is never fixed.
I have seen many code samples but am unable to incorporate the right
solution in my code (am an amateur programmer). Any specific code and
steps will be highly appreciated.
Thanks a ton in advance,
Nirav
|