Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exclusive use of table
Message
De
17/05/2001 02:40:00
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
 
À
17/05/2001 00:59:35
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00508197
Message ID:
00508214
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Hi Jimi,

Try something like:
LOCAL cErrorHandler

* ----- Store the current error handler
cErrorHandler = ON("error")

* ----- Turn Error Handler off
ON ERROR *

* ----- Attempt exclusive open
SELECT 0
USE mytable EXCLUSIVE

* ---- Reset error handler
ON ERROR &cErrorHandler

IF NOT USED("mytable")
    * ----- File wasn't opened
    *       Add appropriate code here
ELSE
    * ----- File opened exclusively
    *       Add appropriate code here
ENDIF
Hope this helps,
Gavin...

>I wanan update the content of a table in my program, before saving of course I have to check if any other is using the table, so i tried to use the example from MSDN about IsExclusive..
>
>my program:
>1: set exclusive off
>2: open in 0 exclusive
>3: if IsExclusive() then
>4: **do the updates here**
>5: else
>6: **prompt error message**
>7: endif
>
>To test the program, I open the database exclusively in another program, and then run the above code. A "access denied" message pops up at line 2.
>
>So what should I do, if I wanna ensure there's no one using the table, and then update it?
>
>Thanks for any help in advance!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform