GetSetting -function

  • Thread starter Thread starter ILIR ISTREFI
  • Start date Start date
I

ILIR ISTREFI

I would be grateful if someone helps me on this function.
I would like to retrieve value from the registry so my database is not
subject to illegal copies.
I have set the folowing value on the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\databaseZZ]
@="1"
What I would like now is code for the switchboard (On Load function),which
would check registry for the above key. If this value doesn't exist then I
would like to open Form with warning "Illegal copy" and quit the Access
database.

*-switchboard is already a startup form.
 
ILIR ISTREFI said:
I would be grateful if someone helps me on this function.
I would like to retrieve value from the registry so my database is not
subject to illegal copies.
I have set the folowing value on the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\databaseZZ]
@="1"
What I would like now is code for the switchboard (On Load
function),which would check registry for the above key. If this value
doesn't exist then I would like to open Form with warning "Illegal
copy" and quit the Access database.

*-switchboard is already a startup form.

You can't use the built-in GetSetting function to read that specific
key, because GetSetting and SaveSetting work only with a specific
subtree of the registry. If you're willing to change your key to place
it under "HKEY_CURRENT_USER\Software\VB and VBA Program
Settings\databaseZZ\Main\" or something like that, then you can use
GetSetting to read it.

If you don't want to do that, there's code posted here:

http://www.mvps.org/access/api/api0015.htm
API: Read a value from the registry

to read any part of the registry.
 
ILIR ISTREFI said:
I would be grateful if someone helps me on this function.
I would like to retrieve value from the registry so my database is not
subject to illegal copies.
I have set the folowing value on the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\databaseZZ]
@="1"
What I would like now is code for the switchboard (On Load
function),which would check registry for the above key. If this value
doesn't exist then I would like to open Form with warning "Illegal
copy" and quit the Access database.

*-switchboard is already a startup form.

I should also point out that this is not likely to be very effective as
a copy-protection scheme, since anyone who really wanted to pirate your
application could create the registry key himself.
 
I need some help with this code.
Can anyone help me how to apply this code because I can't understand what is
this code reading from registry. and how can I apply it to search for
paticular Key which I have previously entered in registry, and if that key
doesn't exist then strart quit procedure


Dirk Goldgar said:
ILIR ISTREFI said:
I would be grateful if someone helps me on this function.
I would like to retrieve value from the registry so my database is not
subject to illegal copies.
I have set the folowing value on the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\databaseZZ]
@="1"
What I would like now is code for the switchboard (On Load
function),which would check registry for the above key. If this value
doesn't exist then I would like to open Form with warning "Illegal
copy" and quit the Access database.

*-switchboard is already a startup form.

I should also point out that this is not likely to be very effective as
a copy-protection scheme, since anyone who really wanted to pirate your
application could create the registry key himself.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
ILIR ISTREFI said:
I need some help with this code.
Can anyone help me how to apply this code because I can't understand
what is this code reading from registry. and how can I apply it to
search for paticular Key which I have previously entered in registry,
and if that key doesn't exist then strart quit procedure

First you would need to create a new standard module in your database,
and paste the code from web page (everything between '********Code
Start************** and '********Code End**************) into that
module. Then save that module -- name it "basRegistry" or
"modRegistry", or something like that.

Then, wherever in your code you need to check the value of that registry
key, you would do something like this:

If fReturnRegKeyValue( _
HKEY_LOCAL_MACHINE, _
"SOFTWARE\databaseZZ", _
"@") _
<> "1" _
Then
MsgBox "Illegal copy!", vbExclamation
Application.Quit
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top