Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PACK command fails- database must be opened exclusively
Message
 
À
18/01/2001 05:47:39
Geert Van Snik
Zorgned Automatisering Bv
Wageningen, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00465050
Message ID:
00465055
Vues:
17
>Hi there,
>
>We use a cleanup routine to cope with deleted records, corrupted indices etc. This routine is accessible to administrators only.
>At the end of the routine, we try to pack the database.
>This returns in the error " database must be opened exclusively"
>However, we DID open it exclusively (or, at least, we tried!)
>
>Our code:
>
>Select 0 && first, close all tables exept one, which is a free table
>lnAantWorkAreas = Select()
>FOR i = 1 TO lnAantWorkAreas
> Select(i)
> IF Upper(Alltrim(Alias())) <> 'SYSTEEM'
> USE
> ENDIF
>ENDFOR
>Set Database to Data_Ov && the database to be packed
>Close Databases && close open databases
>Open Database A_dbsOvPath + '\Data_OV' Exclusive && open database exclusive
>Set Database to Data_Ov
>Pack Database && this returns the error
>
>
>Where do we go wrong?
>
>Thanks in advance,
>
>Geert van Snik
>Zorgned Automatisering
>Wageningen, the Netherlands.


Is the project manager active while you are running this code.
If so, first close it.

Another thing about your code.
The Close databases command closes all the tables in it, so you don't need to close the tables first
if you open a database it is automaticly set as the active one.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform