Changing database location at run-time 
Author Message
 Changing database location at run-time

I would like to change the location of my report  at run-time (name of my
report : myreport.rpt)

I use Crystal Report 8.0 and the OCX Crystl32.ocx in VB6 SP5

I have these lines :

crList.ReportFileName = "myreport.rpt'
crList.DataFiles(0) = "C:\DB\MyDb.mdb"
crList.action = 1

The path in the report is e.g. D:\DB\MyDb.mdb"

and if would like then to change with another path.
The line "crList.DataFiles(0) = "C:\DB\MyDb.mdb"" doesn't run !

Has anobody know how  to do it?

Thansk



Mon, 05 Apr 2004 02:00:00 GMT  
 Changing database location at run-time
You need to retrieve the data locations form the report - use
 iTableCount = crList.RetrieveDataFiles
For i=0 to iTablecount -1
        if crList.Datafiles(i)="D:\DB\MyDb.mdb" then
               crList.Datafiles(i)="C:\DB\MyDb.mdb"
                endif
        next i


Quote:
> I would like to change the location of my report  at run-time (name of my
> report : myreport.rpt)

> I use Crystal Report 8.0 and the OCX Crystl32.ocx in VB6 SP5

> I have these lines :

> crList.ReportFileName = "myreport.rpt'
> crList.DataFiles(0) = "C:\DB\MyDb.mdb"
> crList.action = 1

> The path in the report is e.g. D:\DB\MyDb.mdb"

> and if would like then to change with another path.
> The line "crList.DataFiles(0) = "C:\DB\MyDb.mdb"" doesn't run !

> Has anobody know how  to do it?

> Thansk



Mon, 05 Apr 2004 03:53:32 GMT  
 Changing database location at run-time
YYYYEEEESSSSSS Thanks a lot !!!!!

It's running !!!!!!!!!

Ben



Quote:
> You need to retrieve the data locations form the report - use
>  iTableCount = crList.RetrieveDataFiles
> For i=0 to iTablecount -1
>         if crList.Datafiles(i)="D:\DB\MyDb.mdb" then
>                crList.Datafiles(i)="C:\DB\MyDb.mdb"
>                 endif
>         next i



> > I would like to change the location of my report  at run-time (name of
my
> > report : myreport.rpt)

> > I use Crystal Report 8.0 and the OCX Crystl32.ocx in VB6 SP5

> > I have these lines :

> > crList.ReportFileName = "myreport.rpt'
> > crList.DataFiles(0) = "C:\DB\MyDb.mdb"
> > crList.action = 1

> > The path in the report is e.g. D:\DB\MyDb.mdb"

> > and if would like then to change with another path.
> > The line "crList.DataFiles(0) = "C:\DB\MyDb.mdb"" doesn't run !

> > Has anobody know how  to do it?

> > Thansk



Wed, 07 Apr 2004 02:45:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to change Database location at run time

2. Changing database location at run time

3. Change Database Location at run-time

4. How to change database location at runtime

5. Changing Database\Table locations at run-time from VB6

6. Run Time Change of DB Location, Setting Passwords, and Rpt Location

7. ADO Data Control - Design Time/Run Time database locations

8. CR9 does not change table location at run time

9. Changing Access mdb location in run time

10. Change TTX location at Run-Time - Please Help....

11. Setting a database location at run time?

12. Crystal Report -- set location of database at run time

 

 
Powered by phpBB® Forum Software