Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use, but why?
Message
 
To
18/11/2003 11:39:53
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00851059
Message ID:
00851070
Views:
10
This message has been marked as the solution to the initial question of the thread.
I think your non-visual object open the table in the global datasession (1) that has "set exclusive on" by default.
So the form could not open it in its datasessionid.
In your non-visual object you should issue a "set datasession to the_form_datasession_id" before running the query and after restore the set datasession to the datasession before the method calls.

Franco


>Hi
>
>I have a non-visual object based on the VFP custom baseclass. It has a custom method that selects fields from a VFP table to populates some custom properties.
>
>I have a VFP form that runs in a Private data session. When I call a method in the form that then runs the custom method in the non-visual object, I get a "File in use" error when the select statement tries to execute.
>
>I narrowed down that the problem is related to the datasessions. If I suspend the program after encountering the error and go to the command window and try to execute the select statement, the same error occurs. If I change datasession to 1 and do the same select statement, no error occurs.
>
>I think that I could set datasession to 1 in the code and continue, but, should I and doesn't this defeat the form's Private datasession?
>
>Thanks for any feedback.
>
>Regards,
>
>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform