Link to home
Start Free TrialLog in
Avatar of pnjones
pnjones

asked on

VBA Code to generate and validate a user registration

I need code to generate and validate a user registration code for licensing and product demonstration.

Can anybody help ?

Thanks

Avatar of jadedata
jadedata
Flag of United States of America image

Hey! pnjones,

Throw me a bone here.... What are the requirements for these registration codes?

regards
Jack
Avatar of pnjones
pnjones

ASKER

Ok...
The database will install fine when the user starts the program for the first time they are directed to a registratio form in the database where they enter the username usually company name , i want to base the registration code on the username that the person has entered.
The username will be printed on the forms and reports and the system will check for a valid license number each time the program is opened. I  had based a simple code using asc function and the len of the name but it is too easy to break

Thanks

regards Pat
Where is the "check value" coming from?  Is it hard coded into the application?  Are you storing them in a table of the app?  Is it acquiring it from a web based source"

How do you want to "generate" the reg-key?  What would one look like?  Is it based on an encryption of the data supplied by the user?
"system will check for a valid license number" <--- is this the "registration" code you want to generate?

on top of whatever you are using for "registration" are you using user and group level security?

Steve
Avatar of pnjones

ASKER

Jack,
The license number (registration number) is stored in a table in the database, when the user would request a trail of the software i would email the code based on the username they supplied by email or phone. The license code would have to be numbers and/OR text for example 12RT67Y4 or 12343455.

Steve,
There is only one code to be generated based on the username they enter into the application

Regards

Pat
In design view of a form, enter 12RT67Y4 into tag property of a text box (invisible and hidden away).  Upon launching the application check to see if Environ(("UserName") of UserName() is matching the content of the tag content of the hidden text box.

If it matches it will open the application, if not page a message you like.

Mike
are you dynamically creating a user account in user/group security? if not your app will not be secure.

Steve
Avatar of pnjones

ASKER

Mike ,
Your suggestion would mean i have to compile a version of the database for every user which would be a disaster.

Steve
I am not using access security for this application. I am distributing a mde and want to secure the usage with a license number

Regards

Pat
Avatar of pnjones

ASKER

Maybe I have phrased the question badly , are ther components or dll/ocx addin that i could buy that would give me the above functionality

regards

pat
pnjones: you could create a fixed group of licenses, issuing one to each customer specifically.  Keep these licence number in a web available but secure ftp/http site.  Have your app check this site for that customers license.  There has to be a way to "check" up on the license number or they would not be true "licenses" just issued numbers.
If you do not use security then anyone can start your app without hacking anything. Simple things that are standard procedure (and in the help file) for opening a database like holding the shift key can defeat all of the work you are doing to "licensce" you product. Turning "off" the shift bypass key is not secure unless you use user/group security. Perhaps your target audience does not care about bypassing your "licensing" ... but they might. It is your business decision to make. I am only offering my opinion.

Steve
Avatar of pnjones

ASKER

Steve,

When a user opens any of the main forms in the database the system will check the license to ensure it is a valid number ,an "on open" event called from these forms. Once this is checked the global variable is initialised to true and the function is not required again.
I was hoping for a neat routine or few lines or code which would use some "key" to change the value of the user or company name. I am looking for a component on componentsource which  may help

Regards

pat
Hi pat,

Good Resource here:
The Cryptography API, or How to Keep a Secret
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncapi/html/msdn_cryptapi.asp

Alan
Hi pat,

basically you define a key which is used to encrypt/decrypt any file or value.

So you could parse the clients name "mr alan warren" and your exceedingly complex key to the API and encryt/ decrypt at will. An ocx is a perfect dependancy in which to encapsulate this functionlity.

As part of your deployment you deploy and register your register.ocx then expose it in the  database references.

I use this technology to send encrypted recordset atachments from web-site and decrypt upon reciept and parse into acces tables for processing.


Kindest Regards
Alan
ASKER CERTIFIED SOLUTION
Avatar of ahmedbahgat
ahmedbahgat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Google search: "Cryptography API" + VB

More examples than you can shake a stick at.

Alan