Database for specific computer, help expert please (1 Viewer)

meenctg

Learn24bd
Local time
Today, 22:36
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.
 

Poppa Smurf

Registered User.
Local time
Tomorrow, 02:36
Joined
Mar 21, 2008
Messages
448
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.
 

meenctg

Learn24bd
Local time
Today, 22:36
Joined
May 8, 2012
Messages
133
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.
 

jdraw

Super Moderator
Staff member
Local time
Today, 11:36
Joined
Jan 23, 2006
Messages
15,364
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
 

David R

I know a few things...
Local time
Today, 10:36
Joined
Oct 23, 2001
Messages
2,633
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

Top Bottom