Hello experts. I am trying to make access retrieve serial number of the hard drive or motherboard then store the value in the table field. How can I achieve this?
Hi all, I need to extract hard disk serial number by vba, but I don't mean serial of drive "c", because this serial changes with the windows change, I mean the serial of hard disk. Can someone give me a solution? Thanks in advance.
www.access-programmers.co.uk
This shows a code snippet for the HDD serial number.
Is it possible to make a database unique to the computer it is on so it cannot be shared? I was thinking I could use the machineid I tried to follow the directions on the thread below but I'm having problems getting it to work and also once it's activated, users could just copy the file? I was...
Hello guys While I searched the Internet, I found a function that, I think, implants a file in the computer's registry to prevent the database from being copied and transferred to another computer. I hope someone with experience will tell me if my words are accurate. Can I prevent the transfer...
www.access-programmers.co.uk
which discusses reading from the computer's registry for information to identify the system.
Be aware that if your goal is some kind of "hard license" that blocks use on another machine, you might make it impossible for your customer to upgrade his/her system without some serious help from you.
' credit to my book:
' managing enterprise systems
' with the windows script host
'
' by stein borge
' (c) 2002
' apress
'
' pg.285
'
' arnelgp
'
Public Function HDSerialNumber() As String
Dim strComputer As String
Dim objWMIService As Object
Dim objItem As Object
Dim colItems As Object
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_DiskDrive")
Dim i As Integer
For Each objItem In colItems
Debug.Print i, objItem.NAME, objItem.SerialNumber
i = i + 1
If InStr(objItem.NAME, "PHYSICALDRIVE0") > 0 Then
HDSerialNumber = objItem.SerialNumber
End If
Next
End Function
'http://vb-helper.com/howto_get_cpu_serial_number_id.html
Public Function SystemSerialNumber() As String
Dim mother_boards As Variant
Dim board As Variant
Dim wmi As Variant
Dim serial_numbers As String
' Get the Windows Management Instrumentation object.
Set wmi = GetObject("WinMgmts:")
' Get the "base boards" (mother boards).
Set mother_boards = wmi.InstancesOf("Win32_BaseBoard")
For Each board In mother_boards
serial_numbers = serial_numbers & ", " & board.SerialNumber
Next board
If Len(serial_numbers) > 0 Then serial_numbers = Mid$(serial_numbers, 3)
SystemSerialNumber = serial_numbers
End Function
'http://vb-helper.com/howto_get_cpu_serial_number_id.html
Public Function CpuId() As String
Dim computer As String
Dim wmi As Variant
Dim processors As Variant
Dim cpu As Variant
Dim cpu_ids As String
computer = "."
Set wmi = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\" & _
computer & "\root\cimv2")
Set processors = wmi.ExecQuery("Select * from Win32_Processor")
For Each cpu In processors
cpu_ids = cpu_ids & ", " & cpu.ProcessorId
Next cpu
If Len(cpu_ids) > 0 Then cpu_ids = Mid$(cpu_ids, 3)
CpuId = cpu_ids
End Function
Hi all, I need to extract hard disk serial number by vba, but I don't mean serial of drive "c", because this serial changes with the windows change, I mean the serial of hard disk. Can someone give me a solution? Thanks in advance.
www.access-programmers.co.uk
You can use an UPDATE or APPEND query to store the serial number into a table.