Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't open a table exclusively
Message
De
05/01/2000 12:56:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00313297
Message ID:
00313335
Vues:
32
Paul,

Ok, here is what we got:

1) Run a program instead of calling a form first
2) Make the MAxframe api call ( which makes sure no forms are open):
IF oForms.AnyFormsInstantiated()
=MESSAGEBOX("This form must be opened in Single user mode.",64,"Please Note...")
RETURN
ENDIF

3) Close the table since you are still in the default data session at this point and there are no other forms open (by you). Then reopen it exclusive and zap it(or otherwise clear the table) and close it again. Or whatever you need to do.
4) Call the form using oForms.DoForm from the program.

This of course cannot be done in a multiuser environment, or somebody else may have the table open. Step 2 will ensure that you don't have any forms open, but you need to ensure that no other users are using the table, or your exclusive will fail. You may need to check for a lock on the table and handle the exception.

In a more general note, this may not be the best way to do this, but it will get you by your speed bump.

HTH
Bill
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform