How to Write Programming Code That Can Prevent MS Access 2007 From Being Copied to Another Computer
Network administrators must set up privileges on shared folders to avoid unauthorized personnel from moving or deleting files. Using Visual Basic scripting (VBScript), you can block users from copying a file to another computer. You do this by removing read access from the user's permissions on the file or folder. Removing read access hides the file name from users, so they are unable to copy and paste it to another computer.
Instructions
-
-
1
Click the Windows "Start" button and type "notepad" in to the search text box. Press "Enter" to open the text editor. Notepad lets you create VBScript for your Windows client computers.
-
2
Click the Windows "Start" button and type "internet explorer." This opens the Web browser on your computer. Download the "XCalc.vbs" program provided by Microsoft (see Resources). Save the EXE file to a directory on your computer. The file is small, so it takes only a few seconds to download.
-
-
3
Double-click the "Xcacls_Installer.exe" file downloaded from Microsoft. This file installs the necessary VBScript package that you use to create the code to block users from copying the Access file.
-
4
Return to the Notepad window. Type the following into the file window:
xcalc accessfile.mdb /g user:R /remove
This code removes read permissions from the user named "user." Replace the "accessfile.mdb" with your own Access file name. Replace "user" with the name of the user that you want to block.
-
5
Click the "File" menu item in Notepad. Select "Save As" and type "readaccess.vbs" in the text box. The "VBS" file extension tells Windows to execute the file code as VBScript.
-
1
Tips & Warnings
You can place the new VBScript file on your users' computers or add it to the login script on a Windows server, if you have a server-client setup.