Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Determine Open Document Name/Path

Status
Not open for further replies.

tlatourelle

Programmer
Mar 27, 2002
4
US
I have been working in VB.NET on a system that will detect that a certain application is running (in my case, Microsoft Access) what version and what document is currently open.

I have successfully found that through scanning the PROCESS object that I can determine that MS Access is running and what version, but have not found a good way to locate what document is open in that APP. Any hints?

Thanks,
Tom
 
tlatourelle,

You should probably use System.Services namespace.
It lets use deal with services by building not the regular application but instead so-called Windows Service applications. You can install service application on NT, 2000, and XP platforms only.

Just for begininng, start a new project of type Windows Service...

vladk

 
System.Services namespace" was a typo. It should be "System.ServiceProcess namespace
 
Vladk,

Thanks for your post. I am sure that creating this as a Service would be good. However, I have not seen anything within the PROCESS object that allows me so see what document is currently open and being worked on within a process, only the filename and location of the process itself. Are you aware of how I can detect which document is open within a process?

Thanks,
Tom
 
Thanks, but no. Perhaps I am not being clear on what I am trying to do. I am building a monitoring app that will monitor what databases a user opens during the day using MS Access. This involves several steps:

1) Write a Windows Service
2) Have that service scan the open processes on a timed basis (every 1 or 5 mins, for example) and see if MS Access is running
3) Detect the version and installion location of MS Access
4) Detect what access database (.mdb file) is open with the MS Access process
5) Log this info

I can already accomplish steps 1, 2, 3 and 5. I am having problems finding any commands that will do #4.

Thanks,
Tom
 
tlatourell

No, I am not aware of any specific methods/properties of PROCESS object that would tell which dbm file is open in MS ACCESS.

Howevere, when mdb file is open, it's mdl (or something like that) counterpart is created. Using services will catch such an event.


Hope, this might help...

vladk
 
Actually, I have already done FileSystemObject watchers and it will not work for this project as we are trying to monitor use of any possible database across a wide network, not just their own hard drive. As we have over 10000 access database over 17 different servers, watching the file system is not practical. It could be done to monitor a particular database, but then would not know necessarily who is using it. We could also perform monitoring on the network admin side, but then do not know what access they are using to open that file. It's a headache.

The best suggestion so far actually came from Microsoft, in a post to another user. They said to monitor the "Most Recent Documents" folder and log/record all the .mdb and .mde files that go through there. Than I would know what databases that user is accessing and when. If I place a FSO monitor on that folder, than this method would work.

Thanks,
Tom
 
In reply to a previous poster, you could search for the .ldb file which I think means locked database. When a MSAccess database file is opened, this file is created. Thus, you would only have to search for files that have the .ldb extension.

Hope this helps...
 
Sorry, disregard my previous post. I did not read all the replies before posting mine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top