Results 1 to 2 of 2
  1. #1
    shod90 is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Jan 2016
    Posts
    134

    Code that runs one time only

    Dear Gents,


    I need help please in the following problem:
    I need to make an activation form if the correct activation code was written , then the application runs normally after that , If not i need to prompt the user with that activation form until he write the correct activation code.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You could use API calls: WritePrivateProfileString,and GetPrivateProfileString to write to the registry.when the start form opens, getPrivateProfile to see if the setting exists in the registry,

    If not, WritePrivateProfileString to write the false password to the registry,
    reg=MyProgram
    pass=ABCDE
    Valid=false.

    if it does exist, ask user to enter password,
    compare his entry with the registry entry via, GetPrivateProfileString
    if it matches,WritePrivateProfileString,
    reg=MyProgram
    pass=ABCDE
    Valid=true.

    now that valid is true,never ask user for password again.
    You could also use a table,instead of registry. Either can work for normal users. But both can be defeated by a pro access user. But I'm sure regular users won't try to skirt the code.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-22-2015, 10:06 AM
  2. Code runs in break/debug mode but not in normal mode
    By hansendl in forum Programming
    Replies: 2
    Last Post: 10-15-2014, 07:23 AM
  3. Code Runs Perfectly... Every other time.
    By offie in forum Programming
    Replies: 5
    Last Post: 08-14-2013, 03:45 PM
  4. Making sure code runs regardless
    By nvrwrkn in forum Programming
    Replies: 2
    Last Post: 10-09-2012, 11:39 AM
  5. Date/Time code
    By JayX in forum Access
    Replies: 13
    Last Post: 12-15-2011, 03:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums