vb code for 30 day trial limit

D

Daniel Pineault

It depends how fancy you want to get.

One method would be to use a startup procedure to simply check and exit the
db after that period.

If DateDiff("d",#YourInitialDateGoesHere#,date)>30 Then
Application.Quit
End if

Explain a little more, and perhaps we can guide you a little more.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
L

LightByrd

Dave J said:
How do I code a form or application to shut down after 30 day trial?


Here's another way using the form close event
If either the date is exceeded or more than 20 records entered, it triggers.
It will delete critical form(s), making the program useless.

autonumberID is the Key value in the main table
choose the critical forms that apply
supply whatever date you wish

Dim strMSG As String
strMSG = "This Demo Has Expired" & vbCrLf & "Please Contact Me to Obtain the
Full Version"

If DCount("[autonumberID]", "a critical form") > 20 Or Date > #9/30/2010#
Then
DoCmd.DeleteObject acForm, "frmCriticalform"
DoCmd.DeleteObject acForm, "frmanothercritical form"
MsgBox strMSG, vbCritical
DoCmd.Quit acQuitSaveAll
End If
 
L

LightByrd

LightByrd said:
Dave J said:
How do I code a form or application to shut down after 30 day trial?


Here's another way using the form close event
If either the date is exceeded or more than 20 records entered, it
triggers.
It will delete critical form(s), making the program useless.

autonumberID is the Key value in the main table
choose the critical forms that apply
supply whatever date you wish

Dim strMSG As String
strMSG = "This Demo Has Expired" & vbCrLf & "Please Contact Me to Obtain
the Full Version"

If DCount("[autonumberID]", "a critical form") > 20 Or Date > #9/30/2010#
Then
DoCmd.DeleteObject acForm, "frmCriticalform"
DoCmd.DeleteObject acForm, "frmanothercritical form"
MsgBox strMSG, vbCritical
DoCmd.Quit acQuitSaveAll
End If

OOPS!
Line above should read
If DCount("[autonumberID]", "your main table") > 20 Or Date > #9/30/2010#
wherein "your maun table is the table name holding the main data records
Sorry!
 
Joined
Nov 21, 2009
Messages
79
Reaction score
0
One way is to store the date in an obscure registry/filesystem location during first use or install. Then each time your app runs, calculate the number of days passed and stop running after 30 days.
You can also use ready made trial mechanisms like CryptoLicensing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top