January 15, 2000

GetDriveInfo – Drive serial number and other data

Private Declare Function GetVolumeInformation& Lib “kernel32” Alias _ “GetVolumeInformationA” (ByVal lpRootPathName As String, _ ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _ lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _ lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long)Const MAX_PATH = 260Const FILE_CASE_SENSITIVE_SEARCH = &H1Const FILE_CASE_PRESERVED_NAMES =

GetFileVersionData – Retrieve file versioning information

Private Declare Function GetFileVersionInfoSize Lib “version.dll” Alias _ “GetFileVersionInfoSizeA” (ByVal lptstrFilename As String, _ lpdwHandle As Long) As LongPrivate Declare Function GetFileVersionInfo Lib “version.dll” Alias _ “GetFileVersionInfoA” (ByVal lptstrFilename As String, _ ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long’ Get versioning information about a

GetFileDateInfo – Retrieve all date information about a file

Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As IntegerEnd TypePrivate Type FILETIME dwLowDateTime As Long dwHighDateTime As LongEnd TypePrivate Declare Function CreateFile Lib “kernel32” Alias “CreateFileA” (ByVal _ lpFileName As String, ByVal

DriveExists – Check whether a logical drive exists

Private Declare Function GetLogicalDriveStrings Lib “kernel32” Alias _ “GetLogicalDriveStringsA” (ByVal nBufferLength As Long, _ ByVal lpBuffer As String) As Long ‘ Check whether a given drive exist’ Note that this returns True even if the drive isn’t currently ready’ (e.g. a diskette isn’t in drive A:) Function DriveExists(ByVal sDrive As

GetExecutableFile – Find the program associated to a document file

Private Declare Function FindExecutable Lib “shell32.dll” Alias _ “FindExecutableA” (ByVal lpFile As String, ByVal lpDirectory As String, _ ByVal sResult As String) As LongPrivate Const MAX_PATH = 260Private Const ERROR_FILE_NO_ASSOCIATION = 31&Private Const ERROR_FILE_NOT_FOUND = 2&Private Const ERROR_PATH_NOT_FOUND = 3&Private Const ERROR_FILE_SUCCESS = 32&’ Return the name and path of

DriveType – Determine the type of a drive

Private Declare Function GetDriveType Lib “kernel32” Alias “GetDriveTypeA” _ (ByVal lpRootPathName As String) As LongConst DRIVE_UNKNOWN = 0 ‘ type can’t be determinedConst DRIVE_NO_ROOT_DIR = 1 ‘ wrong argumentConst DRIVE_REMOVABLE = 2Const DRIVE_FIXED = 3Const DRIVE_REMOTE = 4Const DRIVE_CDROM = 5Const DRIVE_RAMDISK = 6’ Determine the type of a drive.

Let ASP’s Server.MapPath Find Your Database

When you use a “DSN-less” data connection to a Microsoft Access database, you must provide the physical path to the database. If your files are kept on your ISP’s Web server, you may have trouble keeping track of the disk drive and path. However, you can let Active Server Pages