PDA

View Full Version : Multiple Users for same mdb and xls Located on a common Server



kfschaefer
06-09-2006, 11:57 AM
I currently have a database that has multiple spreadsheets linked to the mdb. How do I handle the issue of Multiple users at the same time or if a users forgets to close a linked xls and prevents the admin from running the nightly updates?

There is no particular security besides the network sercurity. Also, multiple users may be access the same xls at the same time.

Is there a way to kick out someone and force the xls to close?

Note: MSDE not an option - and my database is the backend to the various spreadsheets. My client does not actual open Access - I am the only user of Access and this process is run nightly - except stops if a users forgot to close the xls.

I also looked he example that verifies if Excel wkbook open forces to close, unfortunately, due to security issues, I believe this could be a problem - due to the fact I will not have admin writes to the server that will allow me to kick the user off.

I also tried;


Private Function IsFileAlreadyOpen(Filename As String) As Boolean
' Returns TRUE if the workbook is open
' be sure to be explicit about your object definitions,
' it will speed up your code and make it easier to debug
Dim xlapp As Excel.Application
Dim xlwk As Excel.Workbook

Set xlapp = GetObject(, "Excel.Application")

Debug.Print xlapp.Workbooks.Count
For Each xlwk In xlapp.Workbooks
Debug.Print xlwk.Name
Next xlwk
xlapp.Quit

End Function

this works great if the spreadsheet is on my machine - but the spreadsheets will be accessed via the server and I need to be able to closes them no matter who or where.

Thanks,

Karen
:banghead: :banghead: :banghead: :aw

Imdabaum
08-21-2006, 09:11 AM
Have you tried using a replication process? Store a copy of the xls sheet on each users computer. Then as they open their backend application they can modify the information locally and then synchronize the data to the main copy on the server.

This is just a thought but it is something people are doing at my work. Each user has a file nameData.mdb that holds all the tables/data. Then the actual application is stored in name.mdb. I have never done it with Excell though. Anyone else know if this is possible?

L@ja
09-11-2007, 03:41 AM
hali,
the network admin have a rights to close any app in any pc what is in the lan.
I cuttet the code from ms scriptcenter:
this code close a notepad in the local masine, so you have to change to run all pc in where you want to kill a excel.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancecreationevent " _
& " within 1 where TargetInstance isa 'Win32_Process'")
i = 0

Do While i = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
If objLatestProcess.TargetInstance.Name = "notepad.exe" Then
objLatestProcess.TargetInstance.Terminate
End If
Loop


additionally info:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

L@ja
09-11-2007, 03:42 AM
sorry, its only monitored...

L@ja
09-11-2007, 03:43 AM
it is a good:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next