
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