Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force dbf to close for index/reindex with Win32API??
Message
De
11/01/2005 19:41:54
 
 
À
11/01/2005 10:19:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00975938
Message ID:
00976244
Vues:
11
Hi,

Thank a lot for the advise. I know of the issue raised
if we force the dbf file to close. However, in some
cases, other application hang/halt, so there is
no one to shut down that application, that why,
I need this feature.

I not sure whether Win32API had this function
to check which application is opening it
and force it to shutdown. If any of you
know of such API, pls let me know. Thank alot


>As Víctor says, it is potentially dangerous to force a file close.
>
>What I did was with pure VFP code: if a file with a special name exists (I used "maintenance.tmp"), this is a sign that the application should be shut down, for maintenance.
>
>(1) A Timer in the application checked every two minutes whether this file exists. If it exists, it will invoke goProgram.OnQuit() (this is the appropriate method in the Visual Extend framework). In theory, this solution is not perfect. If there are pending changes, the application will not quit immediately; the user will see the dialog for saving pending changes, instead. However, this didn't cause me trouble in practice.
>
>(2) On application startup, the application also check for this file. If it exists, the user will get an error message, and the application will quit immediately.
>
>Finally, I tried to do database maintenance, as much as possible, at midnight. But for some emergency repairs (like reindexing when there was an index corruption), I had to institute the procedure outlined above.
>
>>Hi,
>>
>>In order to index/reindex a dbf file, we must open that
>>dbf file exclusively.
>>
>>However, in some case, the file to index/reindex is open by
>>other, therefore, is any Win32API to force the other party
>>to close the file that we want to index/reindex so that
>>we can proceed to index/reindex that file.
>>
>>Any example is appreciated. Thank you
Best Regards
Virusim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform