
Change database location for crystal report 6.0 through vb4
Quote:
> I want to change the report database location via Vb, but it doesn't work.
> here is my codes:
> frmName.Report1.ReportFileNam = App.Path & "\Report1.rpt"
> frmName.Report1.DataFiles(0) = "d:\temp\db.mdb"
> frmName.Report1.Action = 1
> When I created my report, I set the database location to "C:\temp\db.mdb"
> and now I wana change it through VB.
> Any suggestion would be really appreciated.
> Thanks,
> Soheila
Hi Soheila,
This should work but let's look closer. Your code will set the location of the
database for the first table only. If you have more than 1 table in the
report, you will need to set the Datafiles property for the others as well.
You didn't say what the problem was. If you are still getting data from the
original database, open the report in Crystal and go to the File menu option.
There is an option for Save Data with Report. Make sure this is unchecked.
This option saves the old data in the report and will never get the report to
hit the database. It will only use the canned data from the last time the
report was saved in the Report Designer.
Aside from those two things, it should work.
--
Sincerely,
Brian Dong
To reply, remove nospam from the address.