Expiry Date for Data Base

  • Thread starter Thread starter Roger Bell
  • Start date Start date
R

Roger Bell

I have a Data Base that I wish to distribute and set a Date for expiry.

Any help would be appreciated.

Thanks
 
Roger Bell said:
I have a Data Base that I wish to distribute and set a Date for expiry.

Any help would be appreciated.

Thanks

The easiest way would be to hard-code a date into the startup form's Open
event but a "savvy" user could probably defeat that by changing the system
date, depends on whether or not you consider it a risk.

Keith.
www.keithwilby.co.uk
 
Dear Roger, as Keith replied, this will depends on the computers date, so is
better to think another way:

e.g. Number of entering the database, this should be kept somewhere in the
database and being increased +1 each time ones opens the database, but also
think that he/she will run it only once and leave the database opened for a
year :)

GeorgeCY

Ο χÏήστης "Roger Bell" έγγÏαψε:
 
There is a way that only a very knowledgable user would know of and even
then may not find.
First, you should be delivering an mde so users cannot see any code.
Now, you can add a property to a database. You should be able to find the
code to do that. Sorry, I don't have the time at the moment to look it up.
But here is the concept.

If you try to get the value of a property and it doesn't exist, then you
will get an error. In the error routine, add a property to the database
that is the current system date.

But wait, you say. What is to keep the user from resetting the system date?
This will take care of that pretty well.

Use two properties. Installed Date (the first time it was run) and last
opened date(The last date/time the user opened the database).

Now if the when the user opens the database and the system date is < either
of the two dates or the exipration date has passed - Docmd.Quit

That way, you can tell if the user is setting the system date back.

The reason to use an mde is to avoid the user being able to crack into your
database and read the code.
 
Thanks for that Keith. Would you be able to advise me how set a hard-code
date into the form, as I am a relatively new user?

Thanks for your help
 
Roger Bell said:
Thanks for that Keith. Would you be able to advise me how set a hard-code
date into the form, as I am a relatively new user?

Put this in your main form's Open event:

If Date > #01/01/2009# Then
MsgBox "Trial expired. Application will exit."
Cancel = True
DoCmd.Close acForm, Me.Name
End If

Change the date to suit. This assumes that you have Application.Quit in the
form's Close event. Could I draw your attention to Klatuu's posting?

Keith.
www.keithwilby.co.uk
 
Back
Top