Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine who is using a table.
Message
From
29/12/1998 10:51:11
 
 
To
29/12/1998 09:39:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00171134
Message ID:
00171177
Views:
27
>Hello everyone!
>
>I am looking for any sugestions, how I can get an information of who is using a table in network. Let's say I have to track everyone who is holding table and notify him by sending email or something similar that such a procces is about to begin and he needs to close connection. Is there any way to determine group of users who has table opened?

On a cooperative basis, it's easy; share a table among all users, and insert/delete records as you open tables. This is a major headache with SQL Selects and views.

There are API calls that will let a user with adequate privileges examine the list of users who have a file open on a given server; the API call NetFileEnum() will retrieve the information on a Microsoft Network (NT Server, or peer to peer shared files using MS Networking, can be examined with the correct privileges granted to the user). I don't know if you can use it to look at a Novell server or NDS tree (ask me again in a few weeks), but I'd suspect not. If nothing else, I'm not certain what Novell privileges equate to NT's Administrator and Account Operator privileges.

It's a non-trivial API call that needs to construct some pointers to strings and structures, and you should use NetApiBufferAllocate() and NetApiBufferFree() to create and release the buffers used by the NetFileEnum() API call.

Paul Tatavu recently posted code to spin through the open files on a server and return the details of who's got what open; check the Recent Entries in the KnowledgeBase here. Paul's code uses his POINTERS class to manage the structures involved.

I use a wrapper .DLL written in C to manage the API call for me, neatly sidestepping the issues of creating the structures and buffers for the API call in VFP code.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform