Hi.
[color=blue]
> I am getting ready to send out an MDE file to a customer for
> evaluation. What I would like to do is put some code on the
> switchboard load event that says something like.......
>
> if date() > 05/31/2006 the quit the application.[/color]
The code could be something as simple as the following:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrHandler
If (Date > #5/31/2006#) Then
MsgBox "This demo has expired." & vbCrLf & vbCrLf & _
"Please contact us at www.TheSeagulls.com" & vbCrLf & _
"or at (505) 555-5000 for the latest version.", _
vbInformation + vbOKOnly, "Demo Expired!"
DoCmd.Quit
End If
Exit Sub
ErrHandler:
MsgBox "Error in Form_Open( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Sub
The downside to this approach is that while it's easy to implement, it's
just as easy to bypass. The demo can be used forever just by resetting the
computer's system date to 31 May '06 before opening the application, or by
holding the <SHIFT> key down while opening the database so that the startup
form doesn't open or the AutoExec macro doesn't run. There are far more
clever ways to prevent software piracy than this approach.
[color=blue]
> Bottom line is I dont want people to be able to use the program after
> may 31st. So any suggestions are welcome.[/color]
I hate to dampen your enthusiasm, but someone had better tell you.
Compiling the database application into an MDE file protects only the VBA
code from prying eyes (and there are services available that, for a price,
can extract even the code). The tables, relationships, queries, forms,
reports, and macros can be either imported or extracted into a new MDB file.
So the only thing that you might have an opportunity to protect with this
MDE file is the VBA code, and frankly, the code you've asked for is very,
very simple code -- meaning that if you're asking for help on this, then are
you sure that there's any code in your database applicaton worth
protecting -- and annoying your potential customer enough to avoid your
short-term demos in favor of a more experienced Access developer's work?
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"D" <wstandis@theseagulls.com> wrote in message
news:1147837691.226740.205560@i40g2000cwc.googlegr oups.com...[color=blue]
> Hello All,
>
> I am getting ready to send out an MDE file to a customer for
> evaluation. What I would like to do is put some code on the
> switchboard load event that says something like.......
>
> if date() > 05/31/2006 the quit the application.
>
> Bottom line is I dont want people to be able to use the program after
> may 31st. So any suggestions are welcome.
>[/color]