
Changing Access mdb location in run time
Brian,
Isn't 4.6.1 the one that is bundled with VB? I have 7.0 now, but
started with the one that was bundled with VB. I use the following code to
change the database at runtime:
Dim intFiles as Integer, HOMEDB as String
HOMEDB = "C:\PathToMDBFile.mdb"
With CR1
.ReportFileName = App.Path & "\" & Report & ".rpt"
intFiles = .RetrieveDataFiles
For intCounter = 0 To intFiles - 1
.DataFiles(intCounter) = HOMEDB
Next
.Action = 1
End With
The only problem with this approach is that it doesn't work with Sub
Reports. At least I don't think so which is why I posted a thread in this
NG asking about it. If you're just using a standard report, this works, at
least in V 7.0
Good Luck
Lee
Quote:
> Hi:
> I have a Crystal report ( V 4.6.1) designed based on Acess mdb
> file. I wondered if there is a way I can change the location of the mdb
> file using VB in runtime? I noticed that Crystal Report Activex
> Control has datafiles property, but that's only for dbf file.
> Any suggestions will be appreciated
> Brian Fan