Information générale
Catégorie:
Codage, syntaxe et commandes
>>In our application here, there're some tables that cannot be changed by the users (we only put information in it during design time).
>>So, there's no need to have these tables available into the Data directory if I include them into the Project, isn't that right?
>>
>>Well, I've tried to do this last week and I came to the following problem:
>>
>>All our Forms have Private DataSession and they need to have a look at the information stored into these tables. What happens is that if I have one of these tables opened in a DataSession, the function USED() within ANOTHER DataSession returns .F.. But if I try to use the table I get the error *File is in use*!?!?
>>
>>Is this behaviour expected? Did anyone else also face this before?
>>
>Renato,
>
>You need to incldue the AGAIN keyword in your use command as in;
>
> USE MyTable AGAIN
>
>This is because the table is used in another area but not one that is part of the current form's Datasession. The USED() function is only looking in the current data session for a work area with the specified alias name.
Hi Jim, thanks for the input.
I know about the AGAIN clause, but the point is why such a different behaviour on the following situations:
a) I can have as many instances as I wish of a Form class with Private DataSession using a table (without AGAIN ALIAS) that is available at the Data directory. USED() will always return .F. because they are different DataSessions as you've pointed above. But for the same reason there's no need to issue AGAIN ALIAS.
b) If the Table is not available at the Data Directory (if it's included in the Project) than USED() will also return .F., so I guessed I could simply USE the Table as on the first situation. But I cannot.
Why should I issue AGAIN ALIAS if USED() returns .F.?
Doesn't it looks like a bug?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement