Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-17-2019, 11:02 PM   #16
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Validation Key for DB - hash email and exp date

Hi Micron
I do use registry keys as an extra layer of security.
Using those alone would also be easy to hack
The key value(s) are then compared with whatever info is in the app itself.
A bit like two factor authentication systems used in online banking and elsewhere

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 07-18-2019, 04:24 AM   #17
mounty76
Newly Registered User
 
Join Date: Sep 2017
Posts: 87
Thanks: 11
Thanked 0 Times in 0 Posts
mounty76 is on a distinguished road
Re: Validation Key for DB - hash email and exp date

Hi arnelgp, thanks for this, much appreciated. The people most likely to use my db are not prolific hackers and so this simple solution is perfect, most of the people that use it don't know how to make a table in access so I don't think I need to worry about it being hacked, there isn't anything too confidential on there either.

I'm sure this is easy but how do I put a countdown from expiry-30 until expiry so that each time they open the db (when within 30 days of expiry) it says:

XX days until your licence expires, please contact.....

Thanks very much in advance
mounty76 is offline   Reply With Quote
Old 07-18-2019, 05:04 AM   #18
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Validation Key for DB - hash email and exp date

You could create a simple function GetExpiryDate that uses a DLookup to get the expiry date for that licence.
Then use something like
Code:
if GetExpiryDate-Date<=30 Then MsgBox GetExpiryDate-Date & "days until your licence expires ."

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 07-18-2019, 05:28 AM   #19
mounty76
Newly Registered User
 
Join Date: Sep 2017
Posts: 87
Thanks: 11
Thanked 0 Times in 0 Posts
mounty76 is on a distinguished road
Re: Validation Key for DB - hash email and exp date

Hi isladogs,

Sorry my code is terrible, how do I do a DLookup to find the date which is being used for the validation key that is being used?

Cheers
mounty76 is offline   Reply With Quote
Old 07-18-2019, 05:39 AM   #20
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Validation Key for DB - hash email and exp date

The code will be something like

Code:
Function GetExpiryDate()

GetExpiryDate=Dlookup("Field name", "Table Name", "Filter Criteria for current record")

End Function
For example
DLookup("ExpiryDate","tblLicenceInfo", "ID =" & Forms!YourFormName.ID)

For detailed info, look in Access help
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 07-18-2019, 09:28 AM   #21
mounty76
Newly Registered User
 
Join Date: Sep 2017
Posts: 87
Thanks: 11
Thanked 0 Times in 0 Posts
mounty76 is on a distinguished road
Re: 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!
mounty76 is offline   Reply With Quote
Old 07-18-2019, 10:22 AM   #22
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,623
Thanks: 59
Thanked 2,440 Times in 2,340 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Validation Key for DB - hash email and exp date

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.
Attached Files
File Type: zip testExpiry.zip (125.9 KB, 16 views)

__________________
"Never stop learning, because life never stops teaching"

Last edited by arnelgp; 07-18-2019 at 11:25 AM. Reason: add option to enter license
arnelgp is online now   Reply With Quote
Old 07-18-2019, 02:22 PM   #23
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Validation Key for DB - hash email and exp date

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
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by isladogs; 07-18-2019 at 02:28 PM.
isladogs is offline   Reply With Quote
Old 07-18-2019, 02:50 PM   #24
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 806
Thanks: 10
Thanked 162 Times in 156 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: Validation Key for DB - hash email and exp date

Quote:
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?
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 07-18-2019, 10:49 PM   #25
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,839
Thanks: 107
Thanked 2,665 Times in 2,438 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Validation Key for DB - hash email and exp date

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?)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 07-19-2019, 03:26 AM   #26
mounty76
Newly Registered User
 
Join Date: Sep 2017
Posts: 87
Thanks: 11
Thanked 0 Times in 0 Posts
mounty76 is on a distinguished road
Re: Validation Key for DB - hash email and exp date

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.
mounty76 is offline   Reply With Quote
Old 07-19-2019, 04:08 AM   #27
gemma-the-husky
Super Moderator
 
gemma-the-husky's Avatar
 
Join Date: Sep 2006
Location: UK
Posts: 13,769
Thanks: 55
Thanked 1,022 Times in 988 Posts
gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all
Re: Validation Key for DB - hash email and exp date

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.
__________________
Dave (Male!)
Gemma was my dog

if a poster helps you, please click the scales at the bottom left of this posting, or use the thanks button alongside.
gemma-the-husky is offline   Reply With Quote
Old 07-24-2019, 02:28 AM   #28
mounty76
Newly Registered User
 
Join Date: Sep 2017
Posts: 87
Thanks: 11
Thanked 0 Times in 0 Posts
mounty76 is on a distinguished road
Re: Validation Key for DB - hash email and exp date

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?
mounty76 is offline   Reply With Quote
Old 07-24-2019, 08:54 AM   #29
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,623
Thanks: 59
Thanked 2,440 Times in 2,340 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Validation Key for DB - hash email and exp date

I did not encounter any errors.
Attached Files
File Type: zip testExpiry.zip (76.4 KB, 12 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 07-25-2019, 08:11 AM   #30
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 7,623
Thanks: 59
Thanked 2,440 Times in 2,340 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Validation Key for DB - hash email and exp date

here is another update.
Attached Files
File Type: zip testExpiry.zip (125.7 KB, 18 views)

__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
mounty76 (07-26-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Email validation Hello1 Modules & VBA 5 05-08-2019 03:41 PM
Email Validation racer25 Modules & VBA 2 09-22-2009 02:27 AM
Email Validation atiq Tables 1 04-18-2007 03:59 AM
Email Validation beanz1111 Tables 2 02-24-2006 06:15 AM
Email validation antonellac Forms 1 08-29-2004 06:14 AM




All times are GMT -8. The time now is 07:52 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World