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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File in Use error

Status
Not open for further replies.

rt52

Technical User
Jan 26, 2003
39
US
Another new user question: I keep getting a file in use error. I have placed a ON SHUTDOWN CLEAR EVENTS in Main prg, and have tried CLOSE ALL, CLOSE PROGRAM, RELEASE ALL, RELEASE EXTENDED from command window. How may I close the offending file without using task manager? Thanks for your patience. RT
 
rt52

Your post is a little vague. When you say file, do you mean a table?. If so is it always opened for shared use. How many users share the data. If the problem is with a table, I would guess it is that it is being opened exclusively somewhere and not being reopened for shared use.


WTrueman
...if it works dont mess with it
 
Apologies. The file in use is the error message I get. This project has one database, seven tables. Only one user - I am in the process of developing the project. When I exit out of one of the forms to try to modify it, I get this error. When I try to exit Foxpro, either nothing happens or I get a file not available error. How do I find out which file is open? This happens even after CLOSE FORMS, etc from command window. (VFP6) Thanks. RT
 
This is most odd, my early thoughts are.

1) Make sure you're not multi-tasking.
2) close all, clear all, release all
3) set resource off (or RESOURCE=OFF in Config.Fpw)
4) delete the foxuser table, let VFP create a new one.

other than that, do a display status to see what is left after a clear all and close all?



WTrueman
...if it works dont mess with it
 
RT,

The last time I saw this error, I tracked it down to a listbox (or might have been a combo box) which had a rowsource which the form was trying to close.

In other words, you have a list/combo box on the form which you are closing. During the closedown, you are tying to close a table. But the list/combo has that table as its rowsource, and so cannot let it be closed.

To confirm if this is the problem in your case, try removing any list or combo boxes from the form. If that causes the problem to go away, that is the reason for the message.

Mike


Mike Lewis
Edinburgh, Scotland
 
Yes, I have 2 comboboxes which are integral to this form. I can't test now, but if this is the case, what would be a solution. (I really do appreciate your help - this project is a narcotics tracking program for a small non-profit hospital). RT
 
rt52

You could always populate the combos manually, instead of tying them to a recordsource. Make sure rowsource is cleared, and rowsourcetype is set to 0

Code:
with thisform.combo1
   .clear
    select customer
    scan
	.addlistitem(customer.cust_id)
    endscan
endwith




WTrueman
...if it works dont mess with it
 
Thank you - I'll give it a try this weekend and get back with result! RT
 
Good Day.
I was finally able to test the suggestions given. I've populated the combos programmatically but when I try to exit, vpf still hangs and I have to use ctrl-alt-del to end the program. Apparently some file remains open, even though I've issued close all, clear all, clear all extended, quit, etc. Any furthur ideas before I quit return to MS Access? (I've even re-installed VFP). Is there any way to close all open files within VFP that I haven't tried? Anyway, I really appreciate this forum - I have learned some valuable programming techniques! RMT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top