Results 1 to 8 of 8
  1. #1
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125

    Avoiding unauthorised copying of MS Access db to another Machine

    I was kind of wondering whether there is a means to secure an access db such that it can be installed in a machine like other programs. Then prevent it such that when someone copies the files in "program files" to another machine without authorisation, it should not work.

    I will be glad to get your suggestions.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Research publishing database as an executable and licensing.

    Here is one http://social.msdn.microsoft.com/For...orum=accessdev
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If your DB uses code to hide objects like tables, etc. You could store information about the machine in a table. Code during startup could compare the information in the table with the current machine.

  4. #4
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125
    Hello ItsMe, How and what code can i use?

    any samples, I will be gratefull having it.

  5. #5
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    You can also check the name of the computer by using Environ$("Computername").

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Code:
           
            Dim objShell As Shell
            Dim strComponent As String
            Dim strAnswer As String
            Set objShell = CreateObject("shell.application")
            
            strComponent = ""
            strAnswer = ""
            
            strComponent = "ProcessorSpeed"
            strAnswer = objShell.GetSystemInformation(strComponent)
            Debug.Print "ProcessorSpeed = " & strAnswer & vbCrLf
            
            strComponent = ""
            strAnswer = ""
            
            strComponent = "ProcessorArchitecture"
            strAnswer = objShell.GetSystemInformation(strComponent)
            Debug.Print "ProcessorArchitecture = " & strAnswer & vbCrLf
       
            strComponent = ""
            strAnswer = ""
            
            strComponent = "PhysicalMemoryInstalled"
            strAnswer = objShell.GetSystemInformation(strComponent)
            Debug.Print "PhysicalMemoryInstalled = " & strAnswer & vbCrLf
       
            strComponent = ""
            strAnswer = ""
            
            strComponent = "IsOS_DomainMember"
            strAnswer = objShell.GetSystemInformation(strComponent)
            Debug.Print "IsOS_DomainMember = " & strAnswer & vbCrLf
    
            Set objShell = Nothing

  7. #7
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125
    From the code above, what can i use as the table fields and data type? Can I put the code on the UnLoad Event of my first form when the db is opened? In the code above I have not seen a reference to a recordset as well. and what will be the condition if those things do not match what is on the table?

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Demerit View Post
    From the code above, what can i use as the table fields and data type?
    The code above works independent from queries and tables. If you place it behind a form, maybe in a click event, you can pull system information and have it print in the immediate window. You will need to come up with a plan to compare system information, retrieved from code, to a table that stores previously retrieved data. So, the first time the app runs it will pull data from the machine and store it in a table. Also, it would change a condition, like a Boolean, to indicate that the table is populated and said information is the benchmark for subsequent application startups.

    Quote Originally Posted by Demerit View Post
    Can I put the code on the UnLoad Event of my first form when the db is opened?
    I suppose you could. I would probably have it run first thing during startup. Code would determine if this is the first time the app is being run by looking for data in the previously mentioned table or a status Yes/No field. Code would then decide whether or not to pull system info and compare (depending on the status). The result of the initial code would then determine if the app goes forward with startup or halts and gives the user a message by opening an alternate form.

    Quote Originally Posted by Demerit View Post
    In the code above I have not seen a reference to a recordset as well. and what will be the condition if those things do not match what is on the table?
    As I mentioned. There is no recordset or query involved in the code provided. The code just looks at the system info and prints it to the immediate window. You can view the Immediate window in the VBA editor. The keyboard shortcut is Ctrl+G. What you do with the information still needs to be determined when you create a table and, as you mentioned, a recordset to interact with the table. You need to take a look at what the code provides and determine if it will suffice.

    Unfortunately, I could not find VBA to pull the serial number from the CPU. The only examples I could find were in C++ and C#. I found a hint of some success using VB6 and the DLL that C++ depends on but did not get too adventurous to see if I could get it to work in VBA. Right now, I do not even remember the reference that C++ uses. I probably should have made a note of it.

    When I originally posted, I thought I saw some examples of VBA getting real, substantial, system info. Now I can not seem to find any. The info that the code I posted here is stuff that could be easily changed and or replicated from one machine to another. It may or may not be adequate for your needs.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-23-2024, 06:59 AM
  2. Replies: 1
    Last Post: 02-21-2014, 09:16 AM
  3. Access 2007 and 2010 on same machine
    By SmartestIdiot in forum Access
    Replies: 6
    Last Post: 01-26-2014, 01:36 PM
  4. Replies: 1
    Last Post: 07-12-2011, 10:05 AM
  5. Access 2007 - 64 bit Machine
    By greggue in forum Access
    Replies: 1
    Last Post: 09-28-2010, 12:42 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