Locking DB From Time To Time

elliot315

Mr. Question
Local time
Today, 13:45
Joined
Jun 3, 2007
Messages
98
Ok this is my question. I want to sell a DB and there's been a contract with the client. He wants to make 3 payments for the db. Those are monthly payments. I want to create a module that locks the db three days after the date of the payment requesting a code to unlock it. That way I make sure I receive the payment. If not he can not use the db. After entering the third unlocking code it will not ask again for any code no more. The request code must be a random one so those codes will not be the same when asking again (in case he wants to install the db in another machine). Please I'm asking for code and procedures... I'm not that good with vba. Thanks.
 
Given that you said you are not much good with VBA, it begs the question whether all the security is worth the value of the db. If you feel that your client may not pay, then why are you risking selling it to him? Sometimes suppliers deserve the customers they get!

If you must go ahead, why not just secure the F11 key (Tools/StartUp/uncheck spcial access keys), and then bury in the Switchboard Activate event a simple piece of code like this:

Create a new table with two pieces of date data in it which is effectively the date you expect to be paid by and the Code. Call the field "ExpectedPaymentDate" (medium date) and PaymentCode (text) in a table called EPD. Enter the actual ExpectedPaymentDate in the table.

Now put this code in the ACTIVATE event of your Switchboard or lead form

If Date > DLookup("[ExpectedPaymentDate]", "EPD") And DLookup("[PaymentCode]", "EPD") <> "giZmO" Or IsNull(DLookup("[PaymentCode]", "EPD")) Then
Dim strPaymentCode As String
strPaymentCode = InputBox$("Enter Payment Code here", "This database has not been paid for")
If strPaymentCode <> "giZmO" Then
MsgBox "This database will not open until your account is settled"
DoCmd.Quit
Else
Dim mySQL As String
mySQL = "UPDATE EPD SET EPD.PaymentCode = '" & strPaymentCode & "';"
DoCmd.SetWarnings False
DoCmd.RunSQL mySQL
DoCmd.SetWarnings True
End If

End If


This is not the most sophisticated of solutions and is not secure to anyone who knows anything about Access programming but it will stop most novices and may be adequate for your needs.

The PaymentCode I have chosen in giZmO but even though it looks specific to upper and lower-case it actually isn’t.

Hope this helps.
 
Last edited:
Thanks, almost what I want... but not to look for a specific word.. I want it to be a random word so the client call me and tell me what is the word or characters that appear in the screen so I can run a program that generates the unlocking code.
 
Aren't you overcomplicating it; this is not IBM. You can still jazz it up a bit by getting the client to call you by putting a suitable "call this number" message in the message box. You could even then pre-define what specific word he gives you by making that the input box default.

At the end of the day, the database needs to know what the unlock code is so you may as well just give it to him when your client has paid.

As I said - this is a low tech - low cost solution and better than where you are now.
 
Last edited:
the problem with this is that he can get the words and make all the installations he wants on other computers and worst of all... resell the db.
 
If he does that its called theft and in breach of copyright and you could sue him. The question is, is the value of the database worth all the agro? If its a low value (say) less that £1,000, then as a Business Consultant who knows a little about this kinda thing, then as I said I wouldn't bother in getting too fussy with it. If on the other hand its worth thousands, then you can probably afford to get an Access Programmer to give you a reliable and un-breakable unlock code. Its up to you.

The other thing, hasn't your client got more important things to do rather than try and re-sell your db? Unless he knows how to code it, he won't get very far anyway; otherwise why did he employ you in the first place.
 
Maybe this....

Hi elliot315,

Database attached that generates security codes that are only valid for the hour that they were created on the day they were created. Also checks to see if the database is being copied to multiple locations and requires a validation code for each computer the database is copied to.

This is a low tech solution and anyone with a degree of Access experience will be able to pick it apart in a couple of minutes (or less!). However, if you stick a password on the VBA project, hide the database window and if you have the time/inclanation disable the Shift key that allows users to bypass all of this "security" (see this post http://www.access-programmers.co.uk/forums/showthread.php?t=36043&highlight=bypass+screen) this will probably be enough to see off most prying eyes.

All of that said, as ted said if this is a serious money-making application you may want to look at getting a security pro to work on this for you. Although, even that won't make you immune from having your work stolen by a determined/talented individual - it'll just make it harder for them!

db777
 

Attachments

depending on what your contract with him says, he MAY be entitiled to resell it, and it may be you that loses the copyright to future sales.

give him an mde, then he wont be able to sell it, because he wont be able to support it
 

Users who are viewing this thread

Back
Top Bottom