You'll have to write your own code. If you can search back a few months
ago, as there were several posts here pertaining to the subject. If I
were implelemnting this I would approach it in this way...
-Create a table for system values with three columns
[txtSystemValue] - Action value (1.0, 10/31/2005, 2342-KIO4-DWEF)
(KEY)[txtSystemValueDescriptionShort] - (VERSION, RDATE, PRODUCTKEY)
[txtSystemValueType] (Number, Text, Texxt)
[txtSystemValueDescriptionLong] (Version Number, Release Date, Product Key)
The txtSystemValueDescriptionShort (ex HIDEOLDINVAGE) is provided to
allow for a short way of describing the value and is used for actually
retrieving the value.
txtSystemValueDescriptionLong (ex Hide invoices closed after X number of
days) is provided to allow a less kryptic description of the value to
make identification of it easier.
While you're creating the table for use with the product key, you may
find some other uses for it such as including Version number, who the
product is licensed to, etc. The columns are flexible enought to handle
any type of value using the following function (or one similar to it).
The function below lookups up the value and is data type and then
converts the value to the appropriate type. If the data type is TEXT,
the function returns the value from the DLookup(). I used CDbl() for the
number values to provide the greatest amount of flexibility when dealing
with numbers.
Function getSystemValue(strValue As String)
Dim tmpValue As Variant
Dim tmpValueDataType As Variant
tmpValue = DLookup("txtSystemValue", "tblSystemValues",
"txtSystemValueName = '" & strValue & "'")
tmpValueDataType = DLookup("txtValueType", "tblSystemValues",
"txtSystemValueName = '" & strValue & "'")
Select Case tmpValueDataType
Case "Number"
tmpValue = CDbl(tmpValue)'converts to a numeric value
Case "Date"
tmpValue = CDate(tmpValue)'converts to a date value
Case Else
End Select
getSystemValue = tmpValue
End Function
Then you just have to develop how to encode the expiration date into the
product key and the function to extract it. For that I would recommend
embedding the expiration date in to the key and using the 100 year date
for it. (The 100yr date is the number of days since 1/1/1900 appears as
a five digit number. The 100yr date for today is 38600.) To obtain the
100 yr date use the CLng() function on a date value as in CLng(Date()).
From there its a matter of figuring out where to imbed the value into
the product key. The simplist would be to breatk up the 100yr date and
place the values at specific locations in the product key such as
3xxx-8xxx-6xxx-0xxx-0xxx
Your users probably won't be adept enough to figure out that the first
digit of each segment combine for the expiration date. If you wanted to
go I layer deaper, you could convert the individual digits to represent
their alpha equivalent using A as 0 as in
Dxxx-Ixxx-Gxxx-Axxx-Axxx
You could even use a method where that randomly uses the number or alpha
scheme so that the same user gets a varying product key each time a new
one is sent them as in
3xxx-Ixxx-6xxx-Axxx-0xxx
Dxxx-8xxx-6xxx-Axxx-Axxx
Dxxx-Ixxx-Axxx-0xxx-Axxx
The code that extracts the expiration date would again look at the first
character of the segment, determine if is a letter or number, and
convert it to its numerical equivalent if a number.
Of course you could event go 1 step further and alter the location of
the key value in each segment where the segment number indicates where
the value is. Using this the above keys become...
3xxx-xIxx-xx6x-xxxA-Xxx0
Dxxx-x8xx-xx6x-xxxA-xxxA
Dxxx-xIxx-xxAx-xxx0-xxxA
(The x's of course are just random numbers/letters.)
BTW - the function to extract the date would be a function that uses the
Split() (ex: aTest = Split("Dxxx-Ixxx-Axxx-0xxx-Axxx","-"))function to
break up the segments and the get the values.
David H
i have a database which im going to convert into a package using
Visual Studio Tools for the Microsoft Office System and distrubute to
customers. This is the first time ive done this and are unsure how it
will work. i want my program to have a trail period and then by
putting in a product key, you can have full access to the program.
Does anyone know if this is done in Visual Studio Tools for the
Microsoft Office System or will i have to write some code in Access
for my database??