Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBCs under WinNT
Message
De
19/04/1999 16:05:47
 
 
À
19/04/1999 10:24:25
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00209660
Message ID:
00209878
Vues:
17
>Good morning from Peru,
>
>I would like to know if there is any function from the Win NT API which can tell me which users are using a specific file, such as database.dbc
>

Under NT, the API calls NetFileEnum() and NetFileGetInfo() can get the list of files in use, and the users attached to them. They require either Administrator or Account Operator group membership for the user trying to retrieve the information. You'll want to invoke it at level 3, which retrieves arrays of FILE_INFO_3 structures that contain the userids, permissions and locks on the files under consideration.

Using these will require you to use structures, so a class like Paul Tatavu's POINTERS or my CLSHEAP will be needed to construct and decipher the necessary memory structures. You'll also need to deallocate the buffers returned by these functions using NetApiBufferFree() under Windows NT. I believe that Paul has posted an example using netFileEnum() with his POINTERS class in the FIles Section here on UT.

>In this way I could know which users are accesing the database we share on the server. I need to implement a procedure to ensure that the database has no users connected to it before the daily night processes run.
>
>Thanks for your help
>
>Fausto Garcia
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform