Change database location for crystal report 6.0 through vb4 
Author Message
 Change database location for crystal report 6.0 through vb4

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



Sun, 31 Dec 2000 03:00:00 GMT  
 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.



Sun, 31 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Database Location in Crystal Reports 4.5 & VB4

2. Changing Crystal Report database location at runtime

3. Crystal Reports 5 and VB3 (Changing database location from VB script)

4. Reports written in Crystal - database has moved - how can I respecify the database location

5. Crystal Report - CHange TTX location in code

6. changing db location in ODBC for Crystal Report at runtime

7. Crystal report - Change SubReport Location

8. changing db location in ODBC for Crystal Report at runtime

9. Changing Database Location in Crystal?

10. Crystal Reports Database location problem

11. Location of database for Crystal Report - HELP !!!!!!

12. crystal reports- setting database location

 

 
Powered by phpBB® Forum Software