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!

cannot delete file

Status
Not open for further replies.

BlackDice

Programmer
Mar 1, 2004
257
US
I have a report (.frx file) that I make a copy of, then open it as a table in code and insert records so that I can add rows dynamically. That's working great. Except this file is temporary, so I need to delete it when I'm finished.

But when I try to delete it, I get a 'File is in use' error. I've done 'USE IN (lcTempFile)' and plain old 'USE'. (where lcTempFile is the string variable holding the name of the .frx I 'USE'd previously. when I check in the WATCH window to see if it's USED(), it's not, but it won't let me delete the file. The report itself has been closed by this time also. What's the problem?

BlackDice

 

Just to clarify something, when you use a report like a file, the table you are opening does not hold either the path, nor the ".frx" extension. So you should be using:
Code:
USE c:\report1.frx
lcReportfile ="report1"
USE IN (lcReportFile)




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 

Do you see the table opened in the current data session? by using SET and ENTER?


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Do you need it to be a table? Could you use a cursor instead? Then it would clean up after itself when you close it.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top