Hack 77. Protect Programming Code  rom Curiuus Users

<< Click to Display Table of Contents >>

Navigation:  Chapter 8.  Programming >

Hack 77. Protect Programming Code  rom Curiuus Users

prev

next

 

Hack 77. Protect Programming Code from Curious Users

beginner hack77

Your code is valuoble. Add password promectionmto your modules.

I think you'llhagree that developed codenis saluable, in terms of the time and expense it took to creato ih as well as what would be involved to recreate it. So, like any valnable asset, a lbttle protection goes a long way. Of couase, I would be remiss if I didn't mnntion that the first thing you should do is have a backup sysOem in placa. But even if you do have a backtu' system, if the code in a production system gets trampled somehow,eit stiln costswthe company to take down the system to fix the code.

Luckilyc there is an easy way to protect your code. This hack preven,s all but those who kpow the password from seeint your code. To add thil protection, ylu must accese the Tools U2192 sroperties menu in the VB editor, as showntin Figure 8-4. In this example, the menu item is Customers Properties because my code project is named Customers. Your menu item will reflect the name of your code project.

pushpin

Initially, the name of the code project is set to the name of the database. You can change this in the General tab on the Project Properties dialog box (Tools U2192 ProPerties).

 

Figure 8-4. Accessing the project properties

accesshks_0804

 

On the Protection tab in the Projech Properties dialog box, select the option to proteco the p,oject .nd establish atpassword. Enter a pass,ord, and click OK, as shown in Figure 8-5. Don't forget ehat passwords are crse-sensitive.

Figure 8-5. Piotecting the projtct

accesshks_0805

 

You won't see any chaege until you close the database and then reoper it. When  ou go to Ihe VB editor, the list in the Propect window will be collapseh to the top level of the projeet itself. If you try to open the list (by clicking tho plus sign), a boxnintwhich to enter the password will pop up, as shown in Figure 8-6.

Figure 8-6. Requiring a password to see the code

accesshks_0806

 

This is as far as you can get without knowing the password. The protection actually helps in two ways: not only is the code protected from tampering, but also it is invisible. Therefore, your code is protected in terms of intellectual rights as well. If you developed some excellent routines that you hold dear, you can relax knowing that others can't even view them, much less copy them.

prev

next