I used crystal reports designer 6.0 to create a report in VB6. I moved the
app to another computer and the report failed (the rest of the app works).
Crystal reports expects to find the database in the directory used to create
How do I tell Crystal Viewer to look for the data in a different location
when I move the app to another computer.
I placed the following code in the load of the form used to open the report.
What I would like it to use is use a table called "Publishers" or a query
called "ReportQuery" in my database. Any suggestions appreciated.
Dim sDb As Database
Dim QryRpt As QueryDef
Dim dbLocation As String
Dim ReportRecSet As Recordset
dbLocation = App.Path + "\LibraryHOH.MDB"
Set sDb = OpenDatabase(dbLocation)
Set QryRpt = sDb.QueryDefs("ReportQuery")
Set ReportRecSet = QryRpt.OpenRecordset(dbOpenSnapshot)
Report.Database.Tables.Item(1).SetPrivateData 3, ReportRecSet
CRViewer1.ReportSource = Report