Validation Key for DB - hash email and exp date

Hi arnelgp,

Your db is perfect, thank you. One thing I'm struggling with is:

When you open it I'd like it to show a pop up message when the db will expire within 30 days, counting down the days each time you open it. On the pop up I'd like to have two options, one to ack and close the message, the other to send an email to me for an activation key.

I've tried but am struggling with it, any chance you can help out?

Much appreciated!
 
thanks colin for your comment and suggestions.
I will have to study more for that.

on the meantime since the op's need is only simple, then I think this will do for the moment.

I changed the license name and add another date field to determine if the system clock has been set to earlier date.

also added yet another field, Request Code. this one you need to type and make sure it is unique. its 8 char long.


I also added the Notice form (1 to 30 days before expiring).

you need to uncomment the code for the e-mailing part of the button on the notice form and put your own email address and other stuffs.

the email will include the Request Code, which you will use to locate the corresponding license number (that's the trick) that you will send.
 

Attachments

Last edited:
Hi arnel
As you say, the OP wants to keep it simple. I've expressed my views but that's not what he wants to do.
However, I do wonder whether there is any point protecting database licensing unless at least some security is added. I believe you have done some of this in your new version but haven't studied it properly
 
Last edited:
The key value(s) are then compared with whatever info is in the app itself.
Not if the startup code is comparing date() to key value?

As we've both stated elsewhere, Access security requires a multi faceted approach. It's like a chain - as strong as its weakest link. Some would say it's more like key chain than ship anchor chain, n'est pas? Obviously if you want to hide the fact that you're looking at a key value, you can't allow exposing the code. Nor should the key value be a simple date as opposed to a date as a double that's been re-coded. Then again, the requirement was for simplicity. However, if it's for sale and there's any sort of vetting by IT, how much of an impression does a designer get from doing this in a half-baked fashion?
 
I agree completely with your comments about security being only as good as the weakest link. In fact it was partly what I was referring to in my initial reply (post #9?)
 
Thanks guys for your input, however just to reiterate the people using this are not fanatical access users or hackers, this is just a simple way to make it harder for someone to use FOC, it won't be scrutinised by any IT dept. etc. or widely available for sale, this along with disabling the shift key should do the trick for what I'm after. Thanks again.
 
How do you put a count-down? ...


IMO, the best way in general, is to have an autoexec macro, rather than a start up form. The autoexec macro fires, and in the autoexec code you use, you can do whatever startup tests you want - check licence dates, check table connections. so here you can put up a message about the licence countdown, and advise the user to relicence etc. Once all tests are completed, THEN open the start up form.
 
Hi arnelgp,

There seems to be a bug on the code when you enter a new validation code.....

Private Sub Command3_Click()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim NewLicense As String

Set db = CurrentDb
If Trim(Me.txtLicense & "") <> "" Then
If gbolFirstTimeUse Then
If DLookup("License", "AA7D9BDA769", "RequestCode=" & Chr(34) & gstrRequestCode & Chr(34)) <> Me.txtLicense Then
MsgBox "Invalid license key!", vbOKOnly + vbCritical

Else
'TEST
'set to 1 month (i think)
'modify this portion to real world value
'like 1 year (date + 365)
db.Execute ("update AA7D9BDA769 set expiry=#" & Format(Date + 5, "mm/dd/yyyy") & "#, " & _
"LastUsed=#" & Format(Date, "mm/dd/yyyy") & "# where License = " & Chr( _
34) & Me.txtLicense & Chr(34))
bolOK = True
DoCmd.Close acForm, Me.Name
End If

Else
'consecutive use
'check for expiry
'expired so chk the next available license
Set rs = db.OpenRecordset("select top 1 license,expiry from AA7D9BDA769 where RequestCode=" & Chr(34) & gstrRequestCode & Chr(34) & ";")
If rs!LICENSE = Me.txtLicense Then
rs.Edit
rs!Expiry = DateAdd("m", 1, Date)
rs!Lastused = Date
rs.Update
rs.Close
bolOK = True
DoCmd.Close acForm, Me.Name

Else
rs.Close
'invalid license entered
MsgBox "Invalid license key!", vbOKOnly + vbCritical
Me.txtLicense.SetFocus
End If

End If
Else
MsgBox "You need to enter a valid license!", vbOKOnly + vbInformation
Me.txtLicense.SetFocus
End If
Set rs = Nothing
Set db = Nothing
End Sub

Any ideas?
 
I did not encounter any errors.
 

Attachments

arnelgp,

Works perfectly!! Many thanks, this is ideal.

PS; Sorry for delay in replying....work always gets in the way :eek:
 
I have an app that is sold to the public and the purchaser can pay for several additional features so the code I generated needed to incorporate the expiration date as well as 6 features that could be paid for if the user wanted to use them.

To do this, I came up with a simple code that relied on arrays to encode and decode the selections.
I chose 23 alpha digits for year. I used only upper case and I don't use I, L, or O because they can be confusing. I randomly distributed the letters in an array. The first value represented 2016 which was the first license year. the second entry in the array was 2017, etc.
Then I did the same thing for month with 12 options and day with 31 options.
The other parts of the code were generated similarly. The idea is that the digits in the array should have no pattern because you don't want the user comparing last year's code with this year's and seeing only one digit change and that being the year.

I needed 10 digits but made the code 16. 10 were meaningful, 5 were random and changed each time the code was regenerated, and the 16th was a check digit. The check digit was actually the 7th character in the string.
 
Hi everyone.

Read to the end, but I still dont config out how your suggested solution prevent end-user sharing his licensed key to others.
Can we stick with something unique such as hard-drive serial number?
Let say:
Code:
input = VBA_Get_DriveSerialnumber() ' = 123456
Output_key = Custom_Encryption(input) ' = 654321
.
Btw: Anyone know how to get HardDrive Serialnumber with VBA? Looking around but not success yet...
 
Hi everyone.

Read to the end, but I still dont config out how your suggested solution prevent end-user sharing his licensed key to others.
Can we stick with something unique such as hard-drive serial number?
Let say:
Code:
input = VBA_Get_DriveSerialnumber() ' = 123456
Output_key = Custom_Encryption(input) ' = 654321
.
Btw: Anyone know how to get HardDrive Serialnumber with VBA? Looking around but not success yet...
Hi. Have a look here. Hope it helps...
 
Hi everyone.

Read to the end, but I still dont config out how your suggested solution prevent end-user sharing his licensed key to others.
Can we stick with something unique such as hard-drive serial number?
Let say:
Code:
input = VBA_Get_DriveSerialnumber() ' = 123456
Output_key = Custom_Encryption(input) ' = 654321
.
Btw: Anyone know how to get HardDrive Serialnumber with VBA? Looking around but not success yet...
Try a search on this site as I am pretty sure @arnelgp only just answered this a little while back.
 
Hi. Have a look here. Hope it helps...
Really? It is exactly what I am looking for and my intention to protect my application from unauthorized copy. Respected!
 
Really? It is exactly what I am looking for and my intention to protect my application from unauthorized copy. Respected!
Hi. Good luck with your project!
 

Users who are viewing this thread

Back
Top Bottom