Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


958


RetVal = apiGetDriveType(PathName)
Select Case RetVal
Case DRIVE_UNKNOWN
DriveType = “DRIVE ‘“ & PathName & _
“‘ - UNKNOWN”
Case DRIVE_NOT_AVAILABLE
DriveType = “DRIVE ‘“ & PathName & _
“‘ - NOT AVAILABLE”
Case DRIVE_REMOVABLE
DriveType = “DRIVE ‘“ & PathName & _
“‘ - REMOVEABLE DRIVE”
Case DRIVE_FIXED
DriveType = “DRIVE ‘“ & PathName & _
“‘ - FIXED DRIVE”
Case DRIVE_REMOTE
DriveType = “DRIVE ‘“ & PathName & _
“‘ - NETWORK DRIVE”
Case DRIVE_CDROM
DriveType = “DRIVE ‘“ & PathName & _
“‘ - CDROM; DRIVE”
Case DRIVE_RAMDISK
DriveType = “DRIVE ‘“ & PathName & _
“‘ - RAM DRIVE”
Case Else
RetVal = 0
End Select
Debug.Print DriveType
RetVal = 1
Next intChar
End Sub

GetVolumeInformationA
The GetVolumeInformationA function returns information about the file system and volume
information for a valid path.

Declare Function apiGetVolumeInformation _
Lib “Kernel32” _
Alias “GetVolumeInformationA”( _
ByVal lpszPath As String, _
ByVal lpVolNameBuffer As String, _
ByVal lpVolumeNameSize As Long, _
lpVolSerialNo As Long, _
lpMaxFileLen As Long, _
lpSystemFlags As Long, _
ByVal lpSysNamebuffer As String, _
ByVal lpSysNameBufSize As Long) As Long

lpMaxFileLen is the maximum number of characters allowed for a filename on the particular
file system. lpSystemFlags indicates whether the volume is compressed, whether filenames are
Free download pdf