Make Ms access database trial version (1 Viewer)

I am alive

Member
Local time
Today, 10:37
Joined
Aug 29, 2020
Messages
71
Hi all. How can I make my database to be a trial version to automatically shut down after 15 days
 

Ranman256

Well-known member
Local time
Today, 02:37
Joined
Apr 9, 2015
Messages
3,995
program an end date into the code, and a table to save date & and a flag that it ended so it never works again.
lock down the db so users cant edit, or save as mde.

tConfig table
[EndDate],[HasEnded]
2/1/2022 , false

macro AUTOEXEC runs function:
RunCode: Startup()

Code:
public function Startup()
dim vEndDate as date
dim bAllow as boolean

vEndDate = Dlookup("[EndDate]","tConfig")

  'turn off trial
if Date() > vEndDate then
   docmd.SetWarnings false
   docmd.runsql "Update tConfig set [HasEnded]=true"
   docmd.SetWarnings true
endif
bAllow = Dlookup("[HasEnded]","tConfig") = false

   'allow user in?
if Date() < vEndDate and bAllow then
   docmd.OpenMainMenu
else
  msgbox "Trial has ended."
  docmd.quit
endif
end function
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:37
Joined
Nov 25, 2004
Messages
108
Hi all. How can I make my database to be a trial version to automatically shut down after 15 days
Unfortunately, even if you DO convert to an accde, users can get to the tables. How hard is it to modify a record in a table to reset the trial period?
You can try hiding the config table, even using a deep hide approach, so that it is harder to do. Not impossible, harder.

You could look into so more formal approaches. I believe isladogs has some information about licensing on his website.
 

I am alive

Member
Local time
Today, 10:37
Joined
Aug 29, 2020
Messages
71
program an end date into the code, and a table to save date & and a flag that it ended so it never works again.
lock down the db so users cant edit, or save as mde.

tConfig table
[EndDate],[HasEnded]
2/1/2022 , false

macro AUTOEXEC runs function:
RunCode: Startup()

Code:
public function Startup()
dim vEndDate as date
dim bAllow as boolean

vEndDate = Dlookup("[EndDate]","tConfig")

  'turn off trial
if Date() > vEndDate then
   docmd.SetWarnings false
   docmd.runsql "Update tConfig set [HasEnded]=true"
   docmd.SetWarnings true
endif
bAllow = Dlookup("[HasEnded]","tConfig") = false

   'allow user in?
if Date() < vEndDate and bAllow then
   docmd.OpenMainMenu
else
  msgbox "Trial has ended."
  docmd.quit
endif
end function
Thanks so much
 

I am alive

Member
Local time
Today, 10:37
Joined
Aug 29, 2020
Messages
71
program an end date into the code, and a table to save date & and a flag that it ended so it never works again.
lock down the db so users cant edit, or save as mde.

tConfig table
[EndDate],[HasEnded]
2/1/2022 , false

macro AUTOEXEC runs function:
RunCode: Startup()

Code:
public function Startup()
dim vEndDate as date
dim bAllow as boolean

vEndDate = Dlookup("[EndDate]","tConfig")

  'turn off trial
if Date() > vEndDate then
   docmd.SetWarnings false
   docmd.runsql "Update tConfig set [HasEnded]=true"
   docmd.SetWarnings true
endif
bAllow = Dlookup("[HasEnded]","tConfig") = false

   'allow user in?
if Date() < vEndDate and bAllow then
   docmd.OpenMainMenu
else
  msgbox "Trial has ended."
  docmd.quit
endif
end function
It works perfectly. Thanks so much
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:37
Joined
Oct 29, 2018
Messages
17,524
It works perfectly. Thanks so much
Just don't get comfortable with it, I guess, if that's the only restriction you implemented in your app; because as @GPGeorge said, it's very easy to circumvent. Good luck!
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 07:37
Joined
Feb 19, 2013
Messages
13,741
rather than storing in a table, store it as a property, can still be found by someone with the appropriate skills but safer than a table. Code perhaps something like this to run in the open event of the first form to open - this is aircode so might need adjusting

Code:
Form_Open()
Dim prp As Property

on error goto errctl 'in case property does not exist

set prp=currentdb.properties("openOK")
if clng(date())>=prp then
    msgbox "trial period expired", vbok 
    docmd.quit
end if

'rest of your form open event code here, if any

exit sub

errctl:

    Set prp = currentdb.CreateProperty("openOK", dbLong, clng(date())+15)
    currentdb.Properties.Append prp
    resume next

End Sub
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:37
Joined
Nov 25, 2004
Messages
108
rather than storing in a table, store it as a property, can still be found by someone with the appropriate skills but safer than a table. Code perhaps something like this to run in the open event of the first form to open - this is aircode so might need adjusting

Code:
Form_Open()
Dim prp As Property

on error goto errctl 'in case property does not exist

set prp=currentdb.properties("openOK")
if clng(date())>=prp then
    msgbox "trial period expired", vbok
    docmd.quit
end if

'rest of your form open event code here, if any

exit sub

errctl:

    Set prp = currentdb.CreateProperty("openOK", dbLong, clng(date())+15)
    currentdb.Properties.Append prp
    resume next

End Sub
You could further obscure it by using a nonsense string instead of "openOK" for the property name.
 

isladogs

CID VIP
Local time
Today, 07:37
Joined
Jan 14, 2017
Messages
15,661
If you are going to do this, I also suggest you do it properly. Otherwise, it isn't worth doing at all in my opinion...

It would take a matter of seconds to circumvent the trial period end either by changing the system date or by changing the table data.
Using a property would certainly be better or you could add an obscure registry entry.
I would also suggest adding additional security to backup whatever approach you use.

Also, if/when customers purchase your app after the trial period, you need to consider how you can protect against it being used on more workstations than the number of licenses purchased.
 

Cotswold

Member
Local time
Today, 07:37
Joined
Dec 31, 2020
Messages
86
When I applied this sort of security, I would also link the date restriction to user entries. Then if the system date was wound back the security would still work and prevent use. Usually there is little benefit if any transactions and invoices cannot advance beyond a date set. The user would enter the dates required and when the the system saved the record it would write the dates back to the end date set. Even if they amended them in the tables, when it started up the next time any advanced dates would be written back to their end date before closing down.

I wouldn't give an error message that the program was out of date, in case some propeller-head located it in the modules. The program simply wouldn't start up again the next time. Any support call wondering why it didn't work was an easy one to answer. Particularly if copies had been passed on to others.
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:37
Joined
Nov 25, 2004
Messages
108
When I applied this sort of security, I would also link the date restriction to user entries. Then if the system date was wound back the security would still work and prevent use. Usually there is little benefit if any transactions and invoices cannot advance beyond a date set. The user would enter the dates required and when the the system saved the record it would write the dates back to the end date set. Even if they amended them in the tables, when it started up the next time any advanced dates would be written back to their end date before closing down.

I wouldn't give an error message that the program was out of date, in case some propeller-head located it in the modules. The program simply wouldn't start up again the next time. Any support call wondering why it didn't work was an easy one to answer. Particularly if copies had been passed on to others.
Out of curiosity, to those who've implemented trial periods and licensing for Access-based relational database applications, how frequently have you encountered or been aware of attempts to bypass restrictions? Is it possible to even know or estimate that? I ask because it seems like a lot of time and energy could go into solving a problem that isn't egregious. I guess if you sell ten licenses and discover that the application is installed 20 times, that's a big problem. If you sell a thousand licenses and learn that the application is installed 1,020 times, that's a problem, but much smaller.

Realistically, is it worth investing in commercial grade licensing software or should people rely on the things that Access can support more or less natively?
 

MarkK

bit cruncher
Local time
Yesterday, 23:37
Joined
Mar 17, 2004
Messages
7,866
The genius of Access is how quick and easy it is to customize. What I recommend, rather than writing that silver bullet system and securing the crap out of it, is this: write a simple, free, unsecured sample, so people can come to see how awesome you really are as a programmer. Then, convince them to hire you to customize your simple, free, unsecured sample. You trust them. They trust you. You build a relationship. They repeatedly call you back to update your awesome work as their business rules change and grow.

My contention is that as an Access programmer, your biggest monetary loss is obscurity, not theft. As a result, write something widely distributed so people can start to learn your name. Write something that everyone wants you to customize for them. Then, customize it to exactly fit the business problem they need solved.

That is that genius of Access.
 

isladogs

CID VIP
Local time
Today, 07:37
Joined
Jan 14, 2017
Messages
15,661
I really couldn't have put it better and that has been my main approach for many years.

I have used various trial/evaluation/demo versions with some success.
AFAIK, none of them have been cracked or pirated ...but then, how would I find out? Who is going to tell me?

BUT as already stated, if you are going to do this, do it properly...or not at all
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:37
Joined
Oct 29, 2018
Messages
17,524
I came across a business man who had licensing restrictions in his Access product. He told me he discovered some of his clients were able to extend their licenses (can't remember how or for how long). He asked me to help him find a better way to control user access. The solution I recommended to him was to move his licensing feature into a web server. That way, users won't be able to mess with it.
 

Users who are viewing this thread

Top Bottom