Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing Crystal DB locations

Status
Not open for further replies.

OzWolf

Programmer
May 22, 2002
52
AU
Greetings,

I've run into a bit of a problem. An 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
 
Hi there,

I'm not sure of how you are running your reports, but maybe the crystal reports forum will know :)

thanks and good luck!

Transcend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top