if all users are to be allowed read/write permissions from a specific compute and only read permissions from all other PC's then User/group permissions cant be used. You will need to implement your own security.
An idea would be to the PC name and save it in a global variable. Then when you open each form you set the AllowEdits/Additions paramaters etc. depending on whet the PC name is.
You may also be able to use windows (AD) security to allow a specific PC read/write and all others read, but I dont know so much about Windows secirtiy so I'm just guessing here.
Public Function GodkendPC() As Boolean Dim wshNetwork Set wshNetwork = CreateObject("WScript.Network") If wshNetwork.ComputerName = "MY_PC" Then ReadOnly = False' men det kan man ikke Else ReadOnly = True' men det kan man ikke End If End Function
Men det kan vist ikke lade sig gøre, så jeg må til at se på filens sikkerhed, under filens egenskaber, om det kan lade sig gøre der.
If you used User/Group security then you would need to have one user which was allowed to logon with th ecorrect permissions, but that user could alos log on to other PC with the same permissions, and thats something you say you dont want.
So it looks as though you will need to implemenet your own code.
The code example you gave 13/03-2008 15:30:08 in a startup form could be used to set the global variable.
Ja, jeg ved godt at jeg kan bruge den i en global variabel, men det var nemmere, hvis man via koden, kunne gøre hele databasen skrivebeskyttet på en gang.
Noget som.
CurrentDb.ReadOnly = True
Det var om man kunne gøre sådan noget ligende, det er derfor, jeg spørger her. om nogen ved hvordan.
Public Function GodkendPC() As Boolean Dim wshNetwork Set wshNetwork = CreateObject("WScript.Network") If wshNetwork.ComputerName = "MY_PC" Then GodkendPC = True Else GodkendPC = False End If End Function
Jeg bruger denne function og beskytter tabeller og skjuler cmd buttens derefter.
I skal have tak for hjælpen begge to, men point går til Terry, da han var omkring flere mugligheder.
Thanks kabbak I've used a similar method on many occasions and although it requires a bit of coding is very effective. Its also possible to make your own user/group security without too many changes.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.