The approach that I've suggested before involves coding & then embedding
the expiration date into the value provided (if you're trying to setup a
trial period). Basically, you place key digits/characters into specific
locations with in a string such as 262DA-E4C11-8D0S3-235LD-KI223. Since
only you know where the key digits/characters are located and what they
mean, the probability is slim that someone would be able to create a key
that works. This assumes of course that you're shipping a *.MDE file so
that the code that validates the string is hidden or if you want to be
fancy you could put that code into a .dll or some other compiled file
that you ship with the files. I typically suggest using the 100 year
date as the expiration date. (Today's in 100 year format is 38687
derived by using the CLng() [CLng(#12/1/2005#)]. CDate() will convert
the value back.)
Basic Implementation:
Embed the 100 yr date at specific locations in the string
3xxxx-x8xxx-xx6xx-xxx8x-xxxx7
31R5T-F8561-1F671-GQ188-1I8U7
-OR-
3xxxx-x8x6x-xxxxx-xxxxx-xx8x7
31R5T-F8561-1F671-GQ188-1I8U7
Basic Implementation where the key digits are represented by letters A-J
3xxxx-x8xxx-xx6xx-xxx8x-xxxx7
Cxxxx-xHxxx-xxFxx-xxxHx-xxxxG
C1R5T-FH561-16F71-GQ1H8-1I8UG
The last variation would randomly mix wether or not the digits remain
numeric or are represented by letters
3xxxx-x8xxx-xx6xx-xxx8x-xxxx7
Cxxxx-x8xxx-xxFxx-xxx8x-xxxx7
C1R5T-F8561-16671-GQ188-1I8U7
There are of course other things that you can such as adding another
segment of characters which represent the manner in which the value has
been added such as...
95A2D-31R5T-F8561-1F671-GQ188-1I8U7
Z2BS7-C1R5T-FH561-16F71-GQ1H8-1I8UG
99CS1-C1R5T-F8561-16671-GQ188-1I8U7
In this case the 3rd letter in the first segement indicates how the
number was embedded - method A, method B, method C respectively. (If you
really want to have fun you can do thing where the key digit is the sum,
difference, or multiple of two other characters.)
There are just the tips of the iceberg because you can do other things
where instead of having the key digist at the same places in the string,
you build the string in such a manner that the digits are placed
randomly in the string and then extracted.
The code to build the string and the validate it/read it is simple text
manipulation using Mid() to get the values.
David H