Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dilemma with file access denied error
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Dilemma with file access denied error
Miscellaneous
Thread ID:
00736990
Message ID:
00736990
Views:
48
I have a VFP 6 form that runs a Crystal Report, but prior to running the report I have a method in my form that merges two master files together into one for the Crystal Report to use. However, first I copy one master file from location A into location C and the other master file from location B into location C, then I merge (append) the two master files into one. This all works.

But I want to delete the merged master file when the report is done printing or done being previewed in the Crystal Reports preview window. Where can I put this code that deletes the temporary master file because I think the Crystal Reports has the file tied up and so when I go to delete it, it says file access denied. I suppose I could put this code in the Exit button of my VFP form, but it would be nicer to delete the file after the Crystal preview window is closed. Any ideas? Thanks!

Here is the code I use to delete the temporary master files:
* Delete temporary Master files
IF FILE("\data\registry\newmaster.dbf")=.T.
	DELETE FILE "\data\registry\newmaster.dbf"
ENDIF
IF FILE("\data\registry\newmaster.cdx")=.T.
	DELETE FILE "\data\registry\newmaster.cdx"
ENDIF
IF FILE("\data\registry\newmaster.fpt")=.T.
	DELETE FILE "\data\registry\newmaster.fpt"
ENDIF
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Next
Reply
Map
View

Click here to load this message in the networking platform