Đây là các hàm của VB nhưng vẫn chạy tốt trên Access.
Tạo module và copy hàm
'ID cua chip
Function ProcessorID()
Dim s1, s2, s3, k1
Set s1 = GetObject("winmgmts:root\cimv2")
Set s3 = s1.InstancesOf("Win32_Processor", 48)
For Each s2 In s3
k1 = s2.ProcessorID
Next
MsgBox k1
Set s1 = Nothing
Set s3 = Nothing
End Function
'DateCreate File Access hien hanh
Function DateCreateCurFile()
Dim fs, F
Set fs = CreateObject("Scripting.FileSystemObject")
Set F = fs.GetFile(CurrentDb.Properties("Name"))
MsgBox F.DateCreated
End Function
Thử hàm:
Nhấn Ctrl+G mở cửa sổ Immediate.
Nhập:
?DateCreateCurFile ()
Enter
?ProcessorID()
Enter
Tạo module và copy hàm
'ID cua chip
Function ProcessorID()
Dim s1, s2, s3, k1
Set s1 = GetObject("winmgmts:root\cimv2")
Set s3 = s1.InstancesOf("Win32_Processor", 48)
For Each s2 In s3
k1 = s2.ProcessorID
Next
MsgBox k1
Set s1 = Nothing
Set s3 = Nothing
End Function
'DateCreate File Access hien hanh
Function DateCreateCurFile()
Dim fs, F
Set fs = CreateObject("Scripting.FileSystemObject")
Set F = fs.GetFile(CurrentDb.Properties("Name"))
MsgBox F.DateCreated
End Function
Thử hàm:
Nhấn Ctrl+G mở cửa sổ Immediate.
Nhập:
?DateCreateCurFile ()
Enter
?ProcessorID()
Enter