Greetings,
I've run into a bit of a problem. A VB application I'm working on needs to be distributed to a number of different PC's and it will invariably be installed on various drives in differing directories.
The application also contains four Crystal reports. What we need the application to do is set the four Crystal RPT file's table locations to the local Access database when the application starts.
I've tried a number of different ways to get Report.rpt to save with the new locations to no luck. One method I tried was opening the Report.rpt file as a CRAXDRT report, setting the table locations, saving it as Report New.rpt, clearing the CRAXDRT object, killing the Report.rpt file and renaming the Report New.rpt file to Report.rpt. Unfortunately, it appears the CRAXDRT object places a lock on the Report.rpt file and won't allow its deletion.
So, I tried another method by renaming the Report.rpt file to Report Old.rpt then opening it as a CRAXDRT object, setting the table locations then saving it as Report.rpt. The Report Old.rpt file will either be killed when the application closes or at the next startup. Unfortunately, I keep receiving an inexplicable error message of File Already Exists. This occurs after it has renamed Report.rpt to Report Old.rpt and recreated Report.rpt (so the new file exists) and the module that ran the process has been closed. I cannot find what is causing the error to appear or why.
I'd greatly appreciate any solution somebody might have or a reason as to why I keep receiving the above error message. This is getting extremely frustrating.
Cheers,
OzWolf
I've run into a bit of a problem. A VB application I'm working on needs to be distributed to a number of different PC's and it will invariably be installed on various drives in differing directories.
The application also contains four Crystal reports. What we need the application to do is set the four Crystal RPT file's table locations to the local Access database when the application starts.
I've tried a number of different ways to get Report.rpt to save with the new locations to no luck. One method I tried was opening the Report.rpt file as a CRAXDRT report, setting the table locations, saving it as Report New.rpt, clearing the CRAXDRT object, killing the Report.rpt file and renaming the Report New.rpt file to Report.rpt. Unfortunately, it appears the CRAXDRT object places a lock on the Report.rpt file and won't allow its deletion.
So, I tried another method by renaming the Report.rpt file to Report Old.rpt then opening it as a CRAXDRT object, setting the table locations then saving it as Report.rpt. The Report Old.rpt file will either be killed when the application closes or at the next startup. Unfortunately, I keep receiving an inexplicable error message of File Already Exists. This occurs after it has renamed Report.rpt to Report Old.rpt and recreated Report.rpt (so the new file exists) and the module that ran the process has been closed. I cannot find what is causing the error to appear or why.
I'd greatly appreciate any solution somebody might have or a reason as to why I keep receiving the above error message. This is getting extremely frustrating.
Cheers,
OzWolf