适用ACCESS
这两项磁碟机资料须使用API函数方可取得
Private Declare Function GetVolumeInformation Lib "kernel
Function GetVolumn(X As String) As String
If Len(X) <
X = Left(X
Else
X = Left(X
End If
Dim nRet As Long
Dim VolFlags As Long
VolName = Space$(
VolFileSys = Space$(
nRet = GetVolumeInformation(X
VolSN
VolFileSys
If nRet =
GetVolumn = VolName
Else
GetVolumn = ""
End If
End Function
Function GetNumber(X As String) As String
If Len(X) <
X = Left(X
Else
X = Left(X
End If
Dim nRet As Long
Dim VolFlags As Long
VolName = Space$(
VolFileSys = Space$(
nRet = GetVolumeInformation(X
VolSN
VolFileSys
If nRet =
GetNumber = VolSN
Else
GetVolumn = ""
End If
End Function
前面的Declare陈述式宣告一个API函数(GetVolumeInformation)