Julia L. Green is a freelance writer and programmer, whose specialties include Access, Visual Basic, and Web design. She runs her own company, Julia Computer Consulting, based in Watertown, Massachusetts. julia@juliacomputers.com.  This article was published in Access Office VB Advisor Magazine on their Professional Resource CD, May 1999.

Business Perspective

Highlights

Access 97 ??

Excel 97

Visual Basic 6.0

Protect your Investment

You can use this simple routine in Access to ensure your users don't make off with your software.

By Julia L. Green

I've run my own business in Access development for several years now called Green Computer Consulting. One of the more exasperating aspects of this is sending my software to a user via e-mail or post, and getting a call from them saying "Hey I got your software, and I don’t like it. I'm not paying."

They may not like it, but they still have the software to use if they want. And who knows if they're really dissatisfied, or just don't want to pay me?

To avoid this situation, I started charging $200 up front to my customers. This isn't an ideal solution from their point of view, of course, so in the meantime I began looking around for more information on software protection.

I found one piece of shareware on AOL. I downloaded it, , copied down the creator's name and address and sure enough, even his software protection was software protected. Not a problem, I thought. I simply called him, mailed him a $15 check to pay for the software, and wondered if I would ever hear from him again. I didn’t, and there were no other shareware programs available. Other software protection packages range anywhere from $495 to $1,000, which is more than I wanted to pay.

So, I finally I took the time to invent my own Visual Basic software protection application. The code works in several ways, using the Event Procedure in the OnTimer property of a form (a major one), several forms, or every form in your project, depending on how much you want to annoy the customer. Of course, depending on the know-how of your customer, they can open up in Design View and delete the OnTimer Event Procedure. However, there are ways of preventing this, by using the Form.Visible property. You can modify this event so your reminders appear at any day or time of your choosing.

The code is simple. Set your Timer Interval Property to 3000 (allowing three seconds from opening the form on a particular day for it to work). This code works with Excel Macros in Visual Basic, Visual Basic, or Access.

Listing 1 shows the code in the Event Procedure of OnTimer in the Properties Box of a Form.

Listing 1: OnTimer—You can use this code to nag your users, providing incentive for them to pay you for all your hard work. Code of this sort can also be used for other types of reminders to users.

Private Sub Form_Timer()

If Date >= #1/16/99# Then

MsgBox ("You must pay the programmer of " _

& "this application or the database " _

& "will lock." & vbCrLf _

& "Please call 617-926-3413 " _

& "and ask for Julie Green")

Forms!Editor.Visible = False

End If

If Date >= #1/9/99# And Date <= #1/15/99# Then

MsgBox "You have exactly five days to pay " _

& "for this software." & vbCrLf _

& "Please call Julia Green at Green " _

& "Computer Consulting at 617-926-3413 " _

& "for the password you will need " _

& "on 1/15/99."

Me.TimerInterval = 0

End If

If Date >= #1/15/99# Then

Call Password

End If

End Sub

Private Sub Password()

Dim Pwd As String

Do

Pwd = InputBox("You must enter a password " _

& "to validate your software." & vbCrLf _

& "Please call Julie Green at Green " _

& "Computer Consulting at 617-926-3413 " _

& "for your password")

Forms!Editor.Visible = False

Me.TimerInterval = 0

Loop Until Pwd = "oops"

Forms!Editor.Visible = True

End Function

Of course, there are several ways to do this. If you absolutely don’t want users to find the code and delete it, you can implement the code on several forms, and leave out the wait interval "You have exactly five days to pay for this software." If you make it easy for them to find the code, they probably will.

I set the form (called Editor) to Visible=False, and because of the recurring message box there's no way the user can get back in. This also keeps them from being able to find the password in your code. If you put this code in every form of your software, your errant user will probably get fed up quickly and pay you. You can also make the password different on every form to further confuse and divert the user.

If you want to set the Time of day this happens, use this:

If Date >= #1/9/99# && Time >= #12:30 PM#

The above code ensures that the message will appear after noon every day, including and after January 9, 1999. Such persistence will make your delinquent users miserable.

Remember, in this new world of cipher-ridden computer paranoia, it is good to be a careful entrepreneur.