Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    19

    Unanswered: Access registry Unique Computer ID

    Hi again.
    I am trying to figure out a way to lock my access database to specific machines.
    Every machine has a unique identifier as far as i know. I would like to incorporate that into my database but the problem is, Where do you find it?

    I can already make access talk to the registry so if there is a specific registry key that holds the computers unique ID, does anyone know where it is?

    Sounds a bit dramatic but as long as i can get that ID I should be able to work it into my database as a second security measure.

    Cheers

    EDIT: at the moment, my only option is the productID but since my database is going into a corporate environment, i am assuming that the productID will be the same on multiple machines because of corporate licences.
    Last edited by niak32; 09-18-09 at 01:38.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You could retrieve the MAC address of the machine or the ID of its CPU. See the attached file.
    Attached Files Attached Files
    Have a nice day!

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    In this example: http://www.dbforums.com/6274790-post20.html

    (to get the user loginID),

    Just change the code for getting the UserName to instead get the ComputerName.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Jun 2009
    Posts
    19
    Found this little bit of code for getting the serial number of the primary hard drive.

    I did stuff around with the Product ID adding this to that, taking the number apart etc etc too much effort

    Don't think that many hard drives share the same serial number.
    Computer will have the same hard drive serial number after a format and unless someone does something really tricky, this will work for me.

    @Sinndho cheers for that, mac address would be great. Bit too much code for my liking.

    @pkstormy thanks. I will have a look but i was looking for numbers for calculations (not that I did any of course in the end)

    code below, Would love to credit the author but stuffed if i know where i got it from.

    Code:
    Private Sub Secure()
    Dim key1 As String
    
        Dim oFSO As Object
        Dim drive As Object
         
        Set oFSO = CreateObject("Scripting.FileSystemObject")
        Set drive = oFSO.GetDrive("C:\")
        key1 = drive.SerialNumber
         
        Set oFSO = Nothing
        Set drive = Nothing
        'release memory
    
        Select Case key1
        Case 1481259670
        'Niak32 Main Support machine 1481259670
        Me.lblMachine.Caption = "Niak32 Main Support Machine"
        Case Else
        MsgBox ("      Computer not Registered." & vbCrLf & "Please contact support and Quote " & vbCrLf & "               " & key1)
        Me.lblMachine.Caption = "Unknown Machine Please contact Support"
     '   DoCmd.Close acForm, "frm_Main", acSaveNo
     Application.Quit acQuitSaveAll
        Exit Sub
        End Select
    End Sub

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If you look at the "SystemInfo" Class module in the example of the link I supplied, there's a LOT of OTHER information you can get including the information you found or seek.

    (for example, Boot Method, Network Present, ISRemoteSession, Slow Machine, ScreenSaverActive, TempPath, WindowsDirectory, Winver, ProcessorType, OSType, ServicePack, ProductType, etc...etc...)

    Again, Look at the SystemInfo Class module and all the info you can return. It's from a very reliable source (ie. from the MSAccess Developers handbook by Sybex)!

    The FormInfo class module also returns a wealth of imformation form related.
    Last edited by pkstormy; 09-20-09 at 07:54.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jun 2009
    Posts
    19
    Very cool, This looks great. Cheers

Posting Permissions

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