B
Benjamins via AccessMonster.com
Hi,
I am developing a system that reads the drive volume serial number. It was
able to work for most of the PC. But for 2-3 PC, it shows #Error. The code is
below
Function GetPC() As Long
Dim fsAs Variant
Dim d As Variant
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(CurrentDb.Name))
If CLng(d.serialNumber) < 0 Then
GetPC = d.serialNumber * -1
Else
GetPC = d.serialNumber
End If
End Function
Can anybody help in getting the serial number for the rest of the PC and
advise what is the cause for the #Error.
I am developing a system that reads the drive volume serial number. It was
able to work for most of the PC. But for 2-3 PC, it shows #Error. The code is
below
Function GetPC() As Long
Dim fsAs Variant
Dim d As Variant
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(CurrentDb.Name))
If CLng(d.serialNumber) < 0 Then
GetPC = d.serialNumber * -1
Else
GetPC = d.serialNumber
End If
End Function
Can anybody help in getting the serial number for the rest of the PC and
advise what is the cause for the #Error.