Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146

    Question Unanswered: Using Serial Keys in Access

    I'm planning on using a serial key to control permissions for a database that I've built. If I find that the database is being abused, I can easily remove the key and prevent operators from using the database. I'm not sure if this is the correct way to approach this or not, but I've gotten it to work somewhat...

    My form OnLoad contains the following code which obtains the serial key from "SerialKey.txt" on the root directory.

    Private Sub Form_Load()
    Dim x As String
    Open "C:\SerialKey.txt" For Input As #1
    Input #1, x
    Close #1
    If x = "JHDK-SJMF-SJRP-1864-AHJH" Then
    Exit Sub
    Else
    Label2.Visible = True
    Label3.Visible = True
    End If
    End Sub

    I have a progress bar on the same form that is tied to the OnTimer event. If the serial key is correct, the form is to load as usual and allow the progress bar to complete. If the serial is incorrect or missing, I have two labels that I'd like to display explaining that the key is no good. This brings 2 questions to mind:

    1) If the key is incorrect, the two labels are displayed as expected, but the form continues to load the progress bar from the OnTimer event. Provided the key is indeed incorrect, how do I prevent the progress bar from executing? I would simply like to display the labels, pause, and present the user with an option to exit the program.

    2) I don't like the idea of having the actual key in my code and I surely don't like the idea of storing the key locally. I would like to store the key on a web server and have the database connect to and verify the key on load. Is this possible and what would the syntax look like for a situation like this? Working locally makes perfect sense, but connecting to the Internet is throwing me for a loop.

    Thanks in advance for any help and please, if there is an easier way to accomplish this, point me to some resources that I can learn from. Thanks again.

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    1) If the key is incorrect, the two labels are displayed as expected, but the form continues to load the progress bar from the OnTimer event. Provided the key is indeed incorrect, how do I prevent the progress bar from executing? I would simply like to display the labels, pause, and present the user with an option to exit the program.

    - Open another form which contains only that what you want to show.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •