Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Know if a table or database is in use
Message
De
20/06/2003 07:01:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/06/2003 06:54:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00802124
Message ID:
00802129
Vues:
29
>Hi.
>I have a table that could be updated by
>more than one diferent application in
>diferents client computers. Question:
>Is there a way to know if an application
>is using a table or database before
>you open it in another application?

There are basically 2 ways :
1) Using error
local llInUSe
on error llInUSe = .t.
use Table1 exclusive
on error
if llInUse
*...
2) Try to open lowlevel readwrite
local llInUse
lnHandle = fopen('table1.dbf',12)
llInUse = ( lnHandle < 0 and ferror() = 5 )
if lnHandle > 0
 fclose(lnHandle)
 use Table1 exclusive
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform