-----------------------------------------------------------------------
PRODUCT NAME AND VERSION NUMBER
-----------------------------------------------------------------------
KeyedAccess for Access 97, 2000, 2002
v1.0 (shareware)
v1.0u (registered)

-----------------------------------------------------------------------
COMPANY NAME
-----------------------------------------------------------------------
Peter's Software - MS Access Shareware and Freeware for Developers
http://www.peterssoftware.com

-----------------------------------------------------------------------
DESCRIPTION
-----------------------------------------------------------------------
KeyedAccess is an add-on module for Microsoft Access that allows you to lock functionality of your Access application and prompt users for a 16 digit Reg ID/Product Key which you can generate.

Once a valid Reg ID/Product Key is entered, it is stored in the Windows registry under a Local Machine registry key that you specify, and your program can be set in full featured mode. If no valid Reg ID/Product Key is entered, then your program can be set in shareware/demo mode and the user will continue to be prompted for a valid Reg ID/Product Key from time to time.

(Note: Because the KeyedAccess module contains secrets that can be used to unlock applications, please don't distribute the registered source code module unsecured. Always make sure to distribute it as an .mde file)

-----------------------------------------------------------------------
NEW AND SPECIAL IN THIS RELEASE
-----------------------------------------------------------------------
Version 1.0
- This version is brand new

-----------------------------------------------------------------------
HARDWARE AND SOFTWARE REQUIREMENTS
-----------------------------------------------------------------------
	PC with a Pentium 75-megahertz (MHz) or higher processor
	Windows 95 or later, or Microsoft Windows NT Workstation version 4.0 Service Pack 3 or later
	32MB RAM
	1.5MB of available hard-disk space
	Microsoft Access 97, 2000, or 2002


-----------------------------------------------------------------------
INSTALLATION INSTRUCTIONS, GETTING STARTED TIPS, AND DOCUMENTATION
-----------------------------------------------------------------------

IMPORTANT: If you have the demo version, please see the text file "Special Instructions for this Demo.txt". The instructions below are for the registered version.

****************************************************************
*** PART 1:  Setting up the KeyedAccess Module for operation ***
****************************************************************
**************
*** Step 1 ***
**************
Open the downloaded zip file.

This file is named "kau.zip"

**************
*** Step 2 ***
**************
Run the KeyedAccess install program.

Double-click the "Setup.exe" file (you can do this from the WinZip window) and follow the on-screen instructions to install KeyedAccess on your computer.

**************
*** Step 3 ***
**************
Import the basKeyedAccess module from ka####.mdb (where "####" corresponds to your version of Access: 97, 2000, 2002, or 2003), into your database, then open the KeyedAccess module in design mode.

**************
*** Step 4 ***
**************
Change the following module constants to suit your needs:

APPLICATION_NAME: The name of your application

REG_KEY_PREFIX: The name of the registry key where the Reg ID/Product Key will be stored

PRODUCT_KEY_NAME: The name of the registry value where the Reg ID/Product Key will be stored

ACCESS_VERSION_SPECIFIC: Set this to "True" if you have different software versions for the different Access versions and you want separate Reg ID/Product Keys for each.

NUM_OF_TRIES_FOR_REG_ID_ENTRY: The number of times the user will be prompted to enter a valid Reg ID/Product Key before the "UnRegistered" message appears and program execution continues in shareware/demo mode.

**************
*** Step 5 ***
**************
Go to this web site http://www.utm.edu/research/primes/lists/small/100000.txt 

... and choose a unique large prime number for your application/version/Access version.

**************
*** Step 6 ***
**************
Create a new basKeyedAccess module constant for your Lock Prime Number.

In the basKeyedAccess module, you'll see a section entitled "Lock Prime Numbers". Copy one of the examples there if you wish, give it a unique name for your application/version/Access version, and assign it the value of the prime number you selected in Step 5. Examples:

Const SHRINKERSTRETCHER_VERSION_3_ACCESS97_LOCK_PRIME_NUMBER = 234893
Const LASSIE_VERSION_4_ACCESS2002_LOCK_PRIME_NUMBER = 737381
Const LASSIE_VERSION_3_ACCESS2002_LOCK_PRIME_NUMBER = 937843
Const LASSIE_MASTER_LOCK_PRIME_NUMBER = 598327

(You may want to have only one Lock Prime Number and one corresponding set of valid Reg IDs/Product Keys for all of your applications for all versions and all versions of Access. If so, that's OK. But if you want, you can have a different Lock Prime Number and valid Reg ID/Produck Key set for each application you develop, each version of each application, and each version of each application for each version of Access. It depends on your application and how much control you want to have over who has your registered versions.)

**************
*** Step 7 ***
**************
Set your locks - Set one of the Lock Constant values in the "Set your locks here" section  using the constant name you just created. Examples:

Const LOCK_1 = LASSIE_MASTER_LOCK_PRIME_NUMBER
Const LOCK_A2002_1 = LASSIE_VERSION_4_ACCESS2002_LOCK_PRIME_NUMBER 
Const LOCK_A2002_2 = LASSIE_VERSION_3_ACCESS2002_LOCK_PRIME_NUMBER

If a lock constant is set to 0, then no Reg ID/Product Key will validate to it.

(Only one lock needs to be unlocked with a valid Reg ID/Product Key in order for your application to be registered.)

(You can use these different locks to validate Reg IDs/Product Keys from previous versions of your software)

**************
*** Step 8 ***
**************
Copy the constant definition created in step 6 to the basKeyedAccessGenerateRegKeys module declarations section in the kaGen####.mdb database.

You can open the kaGen####.mdb database by clicking Start > KeyedAccess for MS Access > KeyedAccess Demo for Access ####.

**************
*** Step 9 ***
**************
Generate some valid Reg IDs/Product Keys

Open the kaGen####.mdb database, and the basKeyedAccessGenerateRegKeys module in design mode. Edit the "Generate" subroutine. Change the first parm passed to the ng_findValidRegIDs to the name of the constant you created in Step 6. Ex.:

ng_findValidRegIDs MY_LOCK_PRIME_NUMBER_CONSTANT, 10

Close the module and click the "Generate Reg Id/Product Keys..." button on the main menu form. 

You should see valid Reg IDs/Product Keys appearing in the debug window. Save these keys and send them to your customers when they register your application.

***************
*** Step 10 ***
***************
Repeat Steps 5 through 9 for each of your applications/versions/Access versions.




****************************************************************
*** PART 2:  Incorporating KeyedAccess into your application ***
****************************************************************
**************
*** Step 1 ***
**************
Import the basKeyedAccess module into your application, or, if you have the .mde version, add a reference from your application to the ka####.mde library where "####" corresponds to your version of Access: 97, 2000, 2002, or 2003.

**************
*** Step 2 ***
**************
Put the following code in your startup form OnOpen event procedure (or somewhere in your startup process):

Err.Clear
On Error Resume Next
If Eval("ka_ValidateRegIDWithPrompt(True)") Then
    If Err <> 0 Then
        Select Case Err
        Case 2425   
            '* The function is not found
        Case Else
            MsgBox "Error: " & Err & " - " & Err.description
        End Select
        Err.Clear
    Else
        '* Reg Id is valid, and no error, so continue
    End If
Else
    MsgBox "This program is not registered."
    '***************************************************************
    '* If you want, you can set a global variable here to indicate
    '* that the application is in shareware/demo mode
    '*
    '* You can also set the main form caption to read "Unregistered"
    '* or some such thing.
    '***************************************************************
End If

(The Eval statement allows us to execute this code with or without the presence of the basKeyedAccess module. This means you don't have to make any code changes here if you happen to distribute a source code version. Just remove the basKeyedAccess module - you don't want to distribute your registration secrets! - from the database prior to distributing the source code)



-----------------------------------------------------------------------
IMPORTANT KNOWN PROBLEMS
-----------------------------------------------------------------------
The Reg ID/Product keys that KeyedAccess generates are not installation-dependent. That is, one Reg ID/Product Key that unlocks a version of your application will unlock that same version installed on any number of computers. We are working on installation-dependence for the next KeyedAccess version.

-----------------------------------------------------------------------
VERSION HISTORY
-----------------------------------------------------------------------
Please see the help file for this information.

-----------------------------------------------------------------------
PRICING INFORMATION
-----------------------------------------------------------------------
See http://www.peterssoftware.com/buy.htm

-----------------------------------------------------------------------
CONTACT INFORMATION
-----------------------------------------------------------------------
http://www.peterssoftware.com
info@peterssoftware.com

-----------------------------------------------------------------------
DATE OR COPYRIGHT DATE, AND OTHER LEGAL INFORMATION
-----------------------------------------------------------------------
Released 5/27/03
Copyright 2003 Peter's Software