Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use Error (3)
Message
From
20/02/2008 16:45:47
 
 
To
20/02/2008 14:40:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01294418
Message ID:
01294489
Views:
18
>>I have several forms which are used to remove data and re-index a database. The all have a command of the form
>>
>>USE &lcTableName IN 0 EXCLUSIVE ALIAS dep_year_a
>>
>>where &lcUTableName ia "dep_year". The alias changes depending on the form. Preceding the USE command I have commands of the form
>>
>>IF USED(lcTableName)
>>	USE IN &lcTableName
>>ENDIF
>>
>>IF USED('dep_year_a')
>>	USE IN 'dep_year_a'
>>ENDIF
>>
>>
>>
>>If I use a form to add a record and then immediately invoke the form to remove and re-index the database I get the error message
>>
>>Error Number: 3
>>
>>    Message:  File in use
>>   Program Name: Program
>>     Line:   n
>>
>>
>>I know for sure if I get out of the application and re-enter it I do not get the error message, it also appears that if I invoke another form I do not get the error message.
>>
>>Any idea why and how to fix it?
>
>Is it possible you are opening and closing the table in different datasessions, or that you've unknowingly left it open in another datasession?
>
>BTW you might want to use a name expression "( lcTableName )" rather than macro expansion "&lcTableName" for this sort of thing - it's a little faster, can handle spaces in paths if present etc.

I think I fixed the problem by adding the commands
CLOSE DATABASES ALL
OPEM DATABASES fn
at the beginning of the method and the command
CLOSE DATABASES ALL
at the end of the method.
Previous
Reply
Map
View

Click here to load this message in the networking platform