Database for specific computer, help expert please

meenctg

Learn24bd
Local time
Tomorrow, 00:48
Joined
May 8, 2012
Messages
133
I have access database (access 2003). i wanna make it for specific computer, it won't be run another computer that's why i have tried with retrieve cpu id,,, at form startup. But i have failed because processor id isn't unique then i have tried with hard disk drive (c) id which isn't unique because it changes every time when drive formated. I think every hdd has a real manufacturer id which is unique and it not change when drive format. But i have no vb code for retrive the hdd real serial num. Here i wanna get solution for get the hdd real id vb code or have any one idea which will fix my problem.
 
You maybe able to use the ENVIRON(variable) as follows

Sub get_comp_name()
Dim compute_name As String
compute_name = Environ("Computername")
Debug.Print compute_name
End Sub

This code will print the name of the computer or laptop.

But there maybe a possibility the name may change due to a new hard drive or the drive reformatted.
 
This code will print the name of the computer or laptop.

But there maybe a possibility the name may change due to a new hard drive or the drive reformatted.

Thanks for your quick response, i think machine /computer name is changeable. i wanna the serial or id of computer which is not changeable until damage computer.
 
The excel example (below) shows you how to get the motherboard id.
It allows for multiple motherboards, but you can alter the code to remove that.

Code:
Public Function MBSerialNumber() As String

Dim obj As Object
Dim objs As Object
Dim WMI As Object
Dim sAns As String
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
    sAns = sAns & obj.SerialNumber
    If sAns < objs.Count Then sAns = sAns & ","
Next
MBSerialNumber = sAns

End Function
 
The link focus on hard disk driver serial number which is generate every time when new os setup this is not unique. I wanna get the real hard disk serial number like WT62598585
Any specific part can be replaced. HDD are not permanent either.
 

Users who are viewing this thread

Back
Top Bottom